How to setup smart hosts with authentication in postfix

Step-1: Create a text file as follows:

# P=/etc/postfix/password
# vi $P

The format of the client password file is as follows:

#smtp.isp.com       username:password
new.smtp.com        jack:pass123

Save and close the file. Set permissions:

Step-2: Make the password file readable only to root

# chown root:root $P
# chmod 0600 $P
# postmap hash:$P

Step-3: Enable relayhost with authentication.

Open main.cf file, enter:
# vi /etc/postfix/main.cf

Append following config directives:

relayhost = new.smtp.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/password
smtp_sasl_security_options =

Save and close the file.

Step-4: Restart Postfix:
# /etc/init.d/postfix reload

0 comments:

Post a Comment