By MooK
Hi Everyone,
I’m trying to migrate an Exim4/Courier install to Postfix/Dovecot and I’m having a lot of trouble. I’ve read all of the DO guides, and plenty of others, but the differences in configuration files, commands, and setups, make it very difficult to migrate settings.
Here’s what I need to accomplish:
This is what I’ve done so far:
home_mailbox = Maildir/
mailbox_command = /usr/lib/dovecot/deliver
mydestination = localhost, /etc/postfix/domains
virtual_alias_maps = hash:/etc/postfix/virtual
smtpd_tls_cert_file=/etc/postfix/mail.pem
smtpd_tls_key_file=/etc/postfix/mail.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_auth_only = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_tls_auth_only = yes
smtp_tls_security_level = may
smtpd_helo_required = yes
smtpd_client_restrictions = reject_unknown_client_hostname, permit_sasl_authenticated
smtpd_helo_restrictions = reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_recipient_restrictions =permit_mynetworks, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_sasl_authenticated, reject_unauth_destination
smtpd_data_restrictions = reject_unauth_pipelining
(master.cf:)
Uncommented smtp and submission.
Now, as for dovecot, this is what I’ve setup so far:
/etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir:LAYOUT=fs
/etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = yes
/etc/dovecot/conf.d/10-ssl.conf
ssl = required
ssl_cert = </etc/postfix/mail.pem
ssl_key = </etc/postfix/mail.key
Some helpful notes:
openssl s_client -starttls smtp -crlf -connect localhost:587
openssl s_client -starttls -connect localhost:993
Jul 19 17:43:58 hostname postfix/pickup[2666]: BE5E440DAB: uid=0 from=<root>
Jul 19 17:43:58 hostname postfix/cleanup[2717]: BE5E440DAB: message-id=<20150719214358.BE5E440DAB@domain.com>
Jul 19 17:43:58 hostname postfix/qmgr[2667]: BE5E440DAB: from=<root@domain.com>, size=406, nrcpt=1 (queue active)
Jul 19 17:43:58 hostname dovecot: lda(user): msgid=<20150719214358.BE5E440DAB@domain.com>: saved mail to INBOX
Jul 19 17:43:58 hostname postfix/local[2719]: BE5E440DAB: to=<user@domain.com>, relay=local, delay=0.07, delays=0.03/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to command: /usr/lib/dovecot/deliver)
Jul 19 17:45:53 hostname postfix/smtpd[2721]: connect from mail-ig0-f177.google.com[209.85.213.177]
Jul 19 17:45:53 hostname postfix/smtpd[2721]: warning: SASL: Connect to private/auth failed: No such file or directory
Jul 19 17:45:53 hostname postfix/smtpd[2721]: fatal: no SASL authentication mechanisms
==> /var/log/mail.err <==
Jul 19 17:45:53 hostname postfix/smtpd[2721]: fatal: no SASL authentication mechanisms
So I’m a bit confused:
Any help would be appreciated. Thank you.
EDIT:
I have an update:
I followed this setup:
/etc/dovecot/conf.d/10-master.conf
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
Which now results in this error message from an email sent via gmail:
Jul 19 18:15:59 hostname postfix/postscreen[3881]: CONNECT from [209.85.213.171]:34912 to [localhost]:25
Jul 19 18:16:05 hostname postfix/postscreen[3881]: PASS NEW [209.85.213.171]:34912
Jul 19 18:16:05 hostname postfix/postscreen[3881]: warning: cannot connect to service private/smtpd: No such file or directory
Jul 19 18:16:06 hostname postfix/postscreen[3881]: PASS NEW [209.85.213.171]:34912
Jul 19 18:16:06 hostname postfix/postscreen[3881]: DISCONNECT [209.85.213.171]:3491
Jul 19 18:17:46 hostname postfix/postscreen[3881]: close database /var/lib/postfix/postscreen_cache.db: No such file or directory (possible Berkeley DB bug)
Even more confused, now. Sigh.
EDIT2:
Uncommenting smtpd in master.cf solved that problem. It appears to work, but I’ll now have to try imap and see about sending and receiving mail remotely.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Everything appears to work just fine. For those wondering how I set it up:
Postfix Dovecot SpamAssassin ClamAV (Source Compile) OSEClamd Amavisd
The settings in this thread were almost perfect. Setting up amavisd was a problem because I thought that clamd wasn’t running, so I used OSEClamd as a script to run it.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.