
To enable SASL server authentication, you need to Once a client is authenticated, a server can give it “same network” privileges.With this, a remote SMTP client can authenticate to the Postfix SMTP server, and the Postfix SMTP client can authenticate to a remote SMTP server. To address this need, Postfix supports SASL authentication. SMTP clients outside the SMTP server’s network need a different way to get “same network” privileges.Usually, SMTP servers accept mail to remote destinations when the client’s IP address is in the “same network” as the server’s IP address.SMTP servers need to decide whether an SMTP client is authorized to send mail to remote destinations, or only to destinations that the server itself is responsible for.Relayhost = :587 Configure Postfix SASL Authentication Under the Intranet/Internet section, find the, relayhost =, lines and set its value to Gmail SMTP domain name as shown below.
Hence, open the Postfix main configuration file vim /etc/postfix/main.cf In our case, we are setting Postfix relay to Gmail SMTP servers.
In the case of SMTP or LMTP delivery, specify one or more destinations in the form of a domain name, hostname, hostname:port, :port, or :port, separated by comma or whitespace. If your internal DNS uses no MX records, specify the name of the intranet gateway host instead. On an intranet, you can specify your organizational domain name. This configures Postfix is to try to deliver mail directly to the Internet, which is usually not desirable.Īccording to Postfix configuration, different values can be set for the relayhost parameter A relay host can be defined on a Postfix configuration file using the relayhost parameter.īy default, the value of the relayhost parameter is empty. Postfix can be configured to deliver mails indirectly via a relay host. To make further configuration changes, edit the main Postfix configuration file, /etc/postfix/main.cf and make any necessary changes as needed. You can view Postfix configuration values using the postconf command postconf Postfix is now installed with the default configuration. dnf install mailx Configure Postfix to Use Gmail SMTP on CentOS 8 Mail command on CentOS 8 is provided by mailx package. Dnf install cyrus-sasl-plain Install Mail Command on CentOS 8