0

I have a Postfix server that manages internal mail, being the final destination for the organization domain. Anyway the external SMTP for the domain is managed by the ISP server. The messages are then dispatched to internal users mailboxes by fetchmail.
Since one of the users receives the email also on its phone, fetchmail leaves a copy of messages on that user's folder, in order to let the phone client read it.
In this way, when a client inside the organization sends an email to that user, the message is dispatched internally and the phone does not receive it.
Is there a way to force postfix to use an external relay host for a single address whose domain is the final destination for the server?

user2965433
  • 190
  • 10

1 Answers1

0

By using the transport table it is possible to define the smtp nexthop host to be used for delivery of messages for a specific address.
transport table shall be enabled in main.cf file with directive:

transport_maps = hash:/etc/postfix/transport

To route email for a single address to a specific relay host the following line shall be present in transport table:

someone@internaldomain.ext    smtp:external.relay.com

or, alternatively, the following line:

someone@internaldomain.ext    :[external.relay.com]

where the transport protocol is omitted and left to postfix to define the correct one based on the address class (smtp in this case).

Sources:
http://www.postfix.org/postconf.5.html#transport_maps http://www.postfix.org/transport.5.html
man 5 transport

user2965433
  • 190
  • 10