How to force postfix to relay mails to other SMTP servers for particular domains

Discussion in 'Postfix' started by Brian Larkin, Jul 12, 2016.

  1. Brian Larkin

    Brian Larkin New Email

    Joined:
    Jul 12, 2016
    Messages:
    1
    Likes Received:
    0
    I'm new to postfix and could you some guidance. I have a task to send email for specific domains to another SMTP server. The rest of the email needs to go somewhere else. Is this a type of configuration that is supported by postfix?
     


  2. popowich

    popowich EQ Forum Admin Staff Member

    Joined:
    Aug 12, 2008
    Messages:
    8,983
    Likes Received:
    120
    Hi Brian,

    Yes, postfix supports this configuration. First, you'll need to find the config dir, typically /etc/postfix

    Update /etc/postfix/transport configuration with the routes needed to relay email for specific domains to another smtp server. Then tell postfix it's updated with "postmap /etc/postfix/transport"

    Next, in main.cf update your relayhost with the smtp server that all other email should be relayed to. When done run "postfix reload"
     

Want to reply or ask your own question?

It only takes a minute to sign up (and it's free!). Click the orange sign up button to choose a username and then you can ask your own questions on the forum.
Loading...