## Dovecot configuration file
#
syslog_facility = local1
#log_timestamp = .%Y-%m-%d %H:%M:%S 
#login_log_format_elements = user=<%u>method=%m rip=%r lip=%l %c
#login_log_format = %$: %s
#log_path = /var/log/dovecot.log
#info_log_path = /var/log/dovecot-info.log
#mail_debug = yes
#auth_debug_passwords= yes
#auth_verbose= yes
#
ssl=no
#ssl_ca_file = /etc/ssl/<SERVERNAME>.crt
#ssl_cert_file = /etc/ssl/<SERVERNAME>.crt
#ssl_key_file = /etc/ssl/<SERVERNAME>.key 
#ssl_key_password = 
#
# imap imaps pop3 pop3s (use imaps and pop3s if configured for SSL)

protocols = imap pop3 <SSLPROTOCOLS>

#
# Uncomment the ssl_listen statements and comment out listen if using SSL
#
protocol imap {
    listen = *:143
#    ssl_listen = *:993
}

protocol pop3 {
    listen = *:110
#    ssl_listen = *:995
}
#
shutdown_clients = yes

login_chroot = yes
disable_plaintext_auth = no
login_process_per_connection = yes
login_processes_count = 2
login_max_processes_count = 128
login_max_connections = 256
login_greeting = Welcome to <SERVERNAME> Mail Server.
verbose_proctitle = no
maildir_copy_with_hardlinks = yes

protocol imap {
    login_executable = /usr/local/libexec/dovecot/imap-login
    mail_executable = /usr/local/libexec/dovecot/imap
    imap_max_line_length = 65536
    imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}

protocol pop3 {
    login_executable = /usr/local/libexec/dovecot/pop3-login
    mail_executable = /usr/local/libexec/dovecot/pop3
    pop3_uidl_format = %08Xu%08Xv
    pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}

protocol lda {
    postmaster_address = postmaster@<SERVERNAME>
    sendmail_path = /usr/sbin/sendmail
#    mail_plugins = sieve
#    log_path = /var/log/dovecot-deliver.log
#    info_log_path = /var/log/dovecot-deliver.log
}

protocol managesieve {
    # Specify an alternative address:port the daemon must listen on
    # (default: *:2000)
#    listen = localhost:2000
#    managesieve_logout_format = bytes ( in=%i : out=%o )    
}


plugin { 
#    quota = maildir
# Used by both the Sieve plugin and the ManageSieve protocol
#    sieve=~/.dovecot.sieve
#    sieve_dir=~/sieve
}

auth default {
    mechanisms = plain login
    passdb sql {
	args = /usr/local/etc/dovecot-sql.conf
    }
    userdb sql {
	args = /usr/local/etc/dovecot-sql.conf
    }
    user = root
    count = 1
    socket listen {
	master {
	    path = /var/run/dovecot/auth-master
	    mode = 0660
	    user = vmail
	    group = vmail
	}
	client {
	    path = /var/spool/postfix/private/auth
	    mode = 0660
	    user = postfix
	    group = postfix
    	}
    }
}
