
Remember to restart the Postfix service if you make any changes to the configuration. Debian specific: Specifying a file name will cause the first line of that file to be used as the. On Ubuntu/Debian, you can run command dpkg-reconfigure postfix. If you make any changes to postfix config, don’t forget to reload it by running command: /etc/init.d/postfix reload. If you see errors in the log, take corrective action and try again. Example 11.1 Initial /etc/postfix/main.cf file See. If you see anything wrong, you can fix it up by editing /etc/postfix/main.cf file. May 25 14:26:11 localhost postfix/qmgr: 5FD1EB9AA3: removed That way you can just amend the values to suit your SMTP server details, and the rest of the configuration steps can remain following commands append the mail server connection details to the "/etc/postfix/sasl_passwd" file, then display the contents of the file.Ĭat > /etc/postfix/sasl_passwd > /etc/postfix/main.cf, size=473, nrcpt=1 (queue active) smtpdsasltype dovecot Can be an absolute path, or relative to queuedirectory Debian/Ubuntu users: Postfix is. We will use the following environment variables during the configuration. To run from a user with sudo privileges, just prefix with the sudo command. The following operations are performed as the root user. Systemctl start postfix Configure the Email Relay
#Postfix main.cf example debian install
Yum install -y postfix mailx cyrus-sasl cyrus-sasl-plain Install Postfix and some related packages as the root user.ĭnf install -y postfix mailx cyrus-sasl cyrus-sasl-plain

You won't be able to the Gmail SMTP servers if you have 2-factor authentication enabled on your Google account, which is a must these days. You will need to get the details from your email administrator or your hosting provider. We close this section with an example that passes every mechanism except for GSSAPI and LOGIN: /etc/postfix/main.

If the remote server does not offer any of the mechanisms on the filter list, authentication will fail. It's important you have a mail server that accepts connections from the relay. /etc/postfix/main.cf: smtpsaslmechanismfilter plain, login Note. It is really important you make sure port 25 is blocked on the server's local firewall, so only processes on the server can access this email relay.
