gau1991
11 years ago
6 changed files with 70 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||||
|
# Install Dovecot package |
||||
|
|
||||
|
function ee_mod_install_dovecot() |
||||
|
{ |
||||
|
# Install Dovecot |
||||
|
ee_lib_echo "Installing Dovecot, please wait..." |
||||
|
debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" |
||||
|
debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" |
||||
|
$EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ |
||||
|
|| ee_lib_error "Unable to install Dovecot, exit status = " $? |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
# Setup Postfix |
||||
|
|
||||
|
function ee_mod_setup_dovecot() |
||||
|
{ |
||||
|
groupadd -g 5000 vmail |
||||
|
useradd -g vmail -u 5000 vmail -d /var/vmail -m |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
# Setup Postfix |
||||
|
|
||||
|
function ee_mod_setup_postfix() |
||||
|
{ |
||||
|
#Configure Master.cf |
||||
|
sed -i 's/#submission/submission/' /etc/postfix/master.cf |
||||
|
sed -i 's/#smtps/smtps/' /etc/postfix/master.cf |
||||
|
|
||||
|
#Configure main.cf |
||||
|
#postconf "#smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache" |
||||
|
#postconf "#smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache" |
||||
|
#postconf "#smtpd_tls_cert_file=/etc/ssl/certs/dovecot.pem" |
||||
|
#postconf "#smtpd_use_tls=yes" |
||||
|
#postconf "#smtpd_tls_auth_only = yes" |
||||
|
|
||||
|
#Handle SMTP authentication using Dovecot" |
||||
|
postconf "smtpd_sasl_type = dovecot" |
||||
|
postconf "smtpd_sasl_path = private/auth" |
||||
|
postconf "smtpd_sasl_auth_enable = yes" |
||||
|
|
||||
|
postconf "smtpd_relay_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination" |
||||
|
|
||||
|
# other destination domains should be handled using virtual domains |
||||
|
postconf "mydestination = localhost" |
||||
|
|
||||
|
# using Dovecot's LMTP for mail delivery and giving it path to store mail |
||||
|
postconf "virtual_transport = lmtp:unix:private/dovecot-lmtp" |
||||
|
|
||||
|
# virtual mailbox setups |
||||
|
postconf "virtual_uid_maps = static:5000" |
||||
|
postconf "virtual_gid_maps = static:5000" |
||||
|
postconf "virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf" |
||||
|
postconf "virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf" |
||||
|
#postconf "message_size_limit = 20971520" |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
user = vimbadmin |
||||
|
password = password |
||||
|
hosts = 127.0.0.1 |
||||
|
dbname = vimbadmin |
||||
|
query = SELECT goto FROM alias WHERE address = '%s' AND active = '1' |
@ -0,0 +1,5 @@ |
|||||
|
user = vimbadmin |
||||
|
password = password |
||||
|
hosts = 127.0.0.1 |
||||
|
dbname = vimbadmin |
||||
|
query = SELECT domain FROM domain WHERE domain = '%s' AND backupmx = '0' AND active = '1' |
@ -0,0 +1,7 @@ |
|||||
|
user = vimbadmin |
||||
|
password = password |
||||
|
hosts = 127.0.0.1 |
||||
|
dbname = vimbadmin |
||||
|
table = mailbox |
||||
|
select_field = maildir |
||||
|
where_field = username |
Loading…
Reference in new issue