relay based on sender and destination

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

relay based on sender and destination

Angel L. Mateo
Hi,

     I have a mail server relaying for different domains and using a
transport map to deliver local domains.

     Now I need the following:

* Mail from @internal1.com and to @external1.com to be relayed through
relay.provider.com
* the rest of mails, to be deliver or relayed according to transport_maps

     I have found the sender_dependent_relayhost_maps but with this I
can only check the sender but not the destination.

     Any idea?

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
Reply | Threaded
Open this post in threaded view
|

Re: relay based on sender and destination

Matus UHLAR - fantomas
On 19.11.19 10:24, Angel L. Mateo wrote:
>    I have a mail server relaying for different domains and using a
>transport map to deliver local domains.
>
>    Now I need the following:
>
>* Mail from @internal1.com and to @external1.com to be relayed through
>relay.provider.com

do you mean, random spam from any IP and fake @internal1.com sender?
it's rarely useful to relay based on sender domain...

>* the rest of mails, to be deliver or relayed according to transport_maps
>
>    I have found the sender_dependent_relayhost_maps but with this I
>can only check the sender but not the destination.


--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
99 percent of lawyers give the rest a bad name.
Reply | Threaded
Open this post in threaded view
|

Re: relay based on sender and destination

Viktor Dukhovni
In reply to this post by Angel L. Mateo
On Tue, Nov 19, 2019 at 10:24:30AM +0100, Angel L. Mateo wrote:

> * Mail from @internal1.com and to @external1.com to be relayed through
> relay.provider.com

If internal1.com is just one of your internal domains, and the policy
should apply to just some of your internal users, then this is a policy
that is difficult to address with current Postfix transport resolution
architecture.

About the best one can do is route such mail through two Postfix
instances, the first separates out mail from just that domain sending it
to a second dedicated instance, where the transport for the destination
is the custom value you want.

If there's just one internal domain, then you'd simply route all
internal mail out via a different Postfix MTA than the one used for
inbound mail.

If none of these work for you.  You could try Exim.  While it has had a
run of security issues lately, and I personally dislike it for a variety
of reasons, ... it has some built-in customization features not found in
Postfix and probably can express the type of conditions you describe in
its "router" selection logic.

--
    Viktor.