Many programs use (or can be configured to use) SMTP to send messages about their status and so on. By default, postfix is configured to deliver all messages locally and not respond to incoming mails. If you have an environment of multiple servers, this can become quite tedious to log on to each server to check for new mail. This recipe will show you how to relay messages to a central mail relay or message store that also uses SMTP.
Postfix is installed by default on RHEL 7.
In this recipe, we'll combine several options:
We'll allow the server to accept incoming mails
We'll only allow the server to relay messages from recipients in the
mydomain.lan
domainWe'll forward all mails to the
mailhost.mydomain.lan
mailserver
To complete this recipe, perform the following steps:
Edit
/etc/postfix/main.cf
with your favorite editor.Modify
inet_interface
to accept mails on any interface through the following command:inet_interface = all
Add the
smtpd_recipient_restrictions
directive...