Setup Relay Host Port and SMTP Authentication Client in Postfix

This setup will help you to route all outgoing email through your ISP SMTP server using different port number and that SMTP server requires you to authenticate before relaying. For this scenario, the ISP SMTP server is Exim.

1. Edit this file /etc/postfix/main.cf and add relayhost to point to your ISP SMTP server with port number as below: -

relayhost = mail.example.com:2525

2. Add the next parameter to allow Postfix to authenticate before relaying outgoing email as below: -

smtp_sasl_auth_enable = yes

3. Add the following line below to map authentication information as below: -

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

4. Then, add the next parameter to force Postfix to use AUTH LOGIN as below: -

smtp_sasl_mechanism_filter = login

5. Create a file /etc/postfix/sasl_passwd and put the authentication information as below: -

mail.example.com username@example.com:password

6. Next, run the following command below to create the lookup table: -

postmap /etc/postfix/sasl_passwd

7. Then, restart your Postfix service as below: -

service postfix restart

7. Finally, you can monitor your maillog using the command below: -

tail -f /var/log/maillog

Note: The above was tested on Postfix 2.2.10-1 in CentOS 4.4

If you found these helpful, please contribute to help:

3 Comments

  1. Danny June 22, 2008

    Postfix is way easier then sendmail ha :)

  2. sureshkumar March 21, 2009

    HI wingloon

    Thank’s for posted this concepts …………could you know how to configure Postfix for Multiple Client SMTP Authentication
    if you know please scrap me or mail me
    this is my mail id : krisuresh001@gmail.com…. am waiting for your reply

  3. wingloon March 22, 2009

    sureshkumar, i saw your comment in http://www.cyberciti.biz/faq/postfix-multiple-isp-accounts-smarthost-smtp-client/

    can you explain to me what kind of scenario you are looking at?