[Precondition]
OS : Redhat Fedora 2
Postfix : 2.0.18
[How to configure /etc/postfix/main.cf]
1) Create client-info file in /etc/postfix directory,
and input: your.isp.net your_user_name:your_password.
For example:
smtp.sina.com hello_wyq:no_ways
Save and quit it.
#cd /etc/postfix
#vi ./client-info
2) Change mode of client-info only for root
#cd /etc/postfix
#chmod 600 ./client-info
3) Use ’postmap’ to generate client-info database
#cd /etc/postfix
#postmap hash:/etc/postfix/client-info
4) Remove client-info file
#cd /etc/postfix
#rm –f ./client-info
5) Open main.cf file and add seven directives.
# Use sina’s smtp to send emails
Relayhost = smtp.sina.com
# Enable authentication of SASL
smtp_sasl_auth_enable = yes
# Disable anonymous account
smtp_sasl_security_options = noanonymous
# Add client-info for authentication
smtp_sasl_password_maps = hash:/etc/postfix/client-info
# Add restrictions
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,permit_auth_destination reject_unauth_destination
smtpd_client_restrictions = permit_mynetworks,permit_sasl_authenticated
broken_sasl_auth_clients = yes
6) Restart postfix server
#service postfix restart
If you have more questions to understand, please visit http://www.postfix.org/.