Postfix has a method of authentication using SASL. It can use a text file or MySQL table as a special password database.
Configure SMTP AUTH for mail servers
Create a text file as follows:# P=/etc/postfix/password
# vi $PThe format of the client password file is as follows:
#smtp.isp.com username:passwordSave and close the file. Set permissions:
smtp.vsnl.in vivek@vsnl.in:mySecretePassword
# chown root:root $P
# chmod 0600 $P
# postmap hash:$PEnable SMTP AUTH
Open main.cf file, enter:# vi /etc/postfix/main.cfAppend following config directives:
relayhost = smtp.vsnl.inWhere,
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/password
smtp_sasl_security_options =
- relayhost = smtp.vsnl.in : Rely all mail via smtp.vsnl.in ISP mail server.
- smtp_sasl_auth_enable = yes : Cyrus-SASL support for authentication of mail servers.
- smtp_sasl_password_maps = hash:/etc/postfix/password : Set path to sasl_passwd.
- smtp_sasl_security_options = : Finally, allow Postfix to use anonymous and plaintext authentication by leaving it empty.
# /etc/init.d/postfix reloadTest your setup by sending a text email:
$ echo 'This is a test.' > /tmp/test
$ mail -s 'Test' you@example.com < /tmp/test
# tail -f /var/log/maillog
# rm /tmp/test
No comments:
Post a Comment