Dovecot
Dove code Check
# doveconf -n
# doveconf -h
[1]
Install Dovecot.
dovecot.conf
10-auth.conf
10-mail.conf
10-master.conf
10-ssl.conf
20-pop3.conf
[root@mail ~]# yum -y install dovecot
Copy
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.ORG
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.ORG
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.ORG
cp /etc/dovecot/conf.d/10-master.conf /etc/dovecot/conf.d/10-master.conf.ORG
cp /etc/dovecot/conf.d/10-ssl.conf /etc/dovecot/conf.d/10-ssl.conf.ORG
cp /etc/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf.ORG
[2]
This example shows to configure to provide SASL function to Postfix.
[root@mail ~]# vi /etc/dovecot/dovecot.conf
# line 24: uncomment
protocols = imap pop3 lmtp
# line 30: uncomment and change ( if not use IPv6 )
listen = * # (*) here as your value, which is a wildcard meaning all IPv4 addresses
OR
listen = *, :: # For IPv6 addresses, you would use a double colon (::)
[root@mail ~]# vi /etc/dovecot/conf.d/10-auth.conf
# line 10: uncomment and change ( allow plain text auth )
disable_plaintext_auth = no
# line 100: add
auth_mechanisms = plain login
[root@mail ~]# vi /etc/dovecot/conf.d/10-mail.conf
# line 30: uncomment and add
mail_location = maildir:~/Maildir
[root@mail ~]# vi /etc/dovecot/conf.d/10-master.conf
# line 96-98: uncomment and add like follows
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
# Auth process is run as this user.
#user = $default_internal_user
}
# vi /etc/dovecot/conf.d/20-pop3.conf
pop3_uidl_format = %08Xu%08Xv [ Line 50 ]
pop3_client_workarounds = outlook-no-nuls oe-ns-e [ Line 85 ]
[root@mail ~]# vi /etc/dovecot/conf.d/20-pop3.conf
Uncomment or add the following lines:
pop3_uidl_format = %08Xu%08Xv
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
[root@mail ~]# vi /etc/dovecot/conf.d/10-ssl.conf [ SASL ]
# line 8: change (not require SSL)
ssl = no
### master.cf
submission inet n - n - - smtpd
-o syslog_name=postfix/submission
# -o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
-o syslog_name=postfix/smtps
# -o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
# vi /etc/dovecot/conf.d/10-ssl.conf [ For ssl ]
# Uncomment ssl = yes
# Change to point to SSL cert generated in Step 15
ssl_cert = </etc/postfix/ssl/postfix.crt
ssl_key = </etc/postfix/ssl/postfix.key
OR
ssl_cert = </etc/pki/tls/certs/server.crt
ssl_key = </etc/pki/tls/certs/server.key
### Adding Rule firewall
firewall-cmd --permanent --add-service=smtp
firewall-cmd --permanent --add-port=587/tcp
firewall-cmd --permanent --add-port=465/tcp
firewall-cmd --permanent --add-port=110/tcp
firewall-cmd --permanent --add-service=pop3s
firewall-cmd --permanent --add-port=143/tcp
firewall-cmd --permanent --add-service=imaps
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
yum -y install telnet
telnet mail.yourdomain.com smtp
systemctl start dovecot
systemctl enable dovecot
systemctl restart dovecot.service
systemctl enable saslauthd
systemctl restart saslauthd
systemctl restart postfix
systemctl restart dovecot
-------------------------------------------