Search code examples
emailcentossendmailcentos6postfix-mta

Postfix, relay emails to next server with X port


I'm working on migrating my smtp relay from sendmail to postfix. One special thing I did with sendmail was to get around ISP port 25 blocks by creating another esmtp definition in sendmail to send to another port.

In /etc/mail/sendmail.cf I added the following

Mesmtp143,  P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
            T=DNS/RFC822/SMTP,
            A=TCP $h 143

That allowed me to define an relay for a certain domain like this in /etc/mail/mailertable

domain.com esmtp143:[domain.com]

I'm looking for the equivalent in postfix. I've looked through the docs and walkthroughs, but can't seem to find this setting.

The best I can come up with is editing the /etc/postfix/transport file too have a line

domain.com smtp:[domain.com:143]


Solution

  • Answer is almost what I thought.

    In /etc/postfix/transport you need to put the following to deliver to anything other than port 25

    domain.com smtp:domain.com:143