2.7. Delivering email from Postfix to Dovecot running on the same host
You can configure Postfix to deliver incoming mail to Dovecot on the same host by using LMTP over a UNIX socket. This socket enables direct communication between Postfix and Dovecot on the local machine.
Prerequisites
- You have the root access.
- You have configured a Postfix server.
- You have configured a Dovecot server, see Configuring and maintaining a Dovecot IMAP and POP3 server.
- You have configured the LMTP socket on your Dovecot server, see Configuring an LMTP socket and LMTPS listener.
Procedure
Configure Postfix to use the LMTP protocol and the UNIX domain socket for delivering mail to Dovecot in the
/etc/postfix/main.cffile:If you want to use virtual mailboxes, add the following content:
virtual_transport = lmtp:unix:/var/run/dovecot/lmtpIf you want to use non-virtual mailboxes, add the following content:
mailbox_transport = lmtp:unix:/var/run/dovecot/lmtp
Reload
postfixto apply the changes:# systemctl reload postfix
Verification
-
Send an test email to verify that the LMTP socket works correctly. Check the mail logs in
/var/log/maillogfor any errors.