2.8. Delivering email from Postfix to Dovecot running on a different host
You can establish a secure connection between Postfix mail server and the Dovecot delivery agent over the network. To do so, configure the LMTP service to use network socket for delivering mail between mail servers. By default, the LMTP protocol is not encrypted. However, if you configured TLS encryption, Dovecot uses the same settings automatically for the LMTP service. SMTP servers can then connect to it by using the STARTTLS command over LMTP.
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 INET domain socket for delivering mail to Dovecot in the
/etc/postfix/main.cffile by adding the following content:mailbox_transport = lmtp:inet:<dovecot_host>:<port>Replace
<dovecot_host>with the IP address or hostname of the Dovecot server and<port>with the port number of the LMTP service.Reload the
postfixservice to apply the changes:# systemctl reload postfix
Verification
- Send an test email to an address hosted by the remote Dovecot server and check the Dovecot logs to ensure that the mail was successfully delivered.