[ale] Relaying email OUT based on return sender domain

Chris Ricker chris.ricker at gmail.com
Wed May 1 23:17:50 EDT 2013


On 5/1/13 4:23 PM, Lightner, Jeff wrote:
>
> Note:  I am NOT asking about aliasing of INBOUND emails.  I am asking 
> about emails being sent OUTBOUND.
>
> We have a need to send emails via different internal email relay 
> servers based on the return sender associated with the email.   
> Previously I did this in HP-UX using sendmail's "smarttable" facility.
>
> We now need to replicate the setup on RHEL5 which also uses sendmail.  
>  I haven't really had a chance to look into it myself as I'm tasked 
> with other priorities but the co-worker that tried to do this last 
> year and the new one trying to do it now don't seem to be getting 
> anywhere in replicating this.
>
> The idea would be if I send an email and set the return sender as say 
> billybob at mydomain1.com <mailto:billybob at mydomain1.com> it would relay 
> through our MS Exchange server.  On the other hand if I set the return 
> sender as billybob at otherdomain.com <mailto:billybob at otherdomain.com> 
> it would relay through a separate Sendmail server I have for that 
> purpose.    The difference here is that the Exchange server and 
> Sendmail both send their email via different internet facing IPs.
>
> Does anyone know how to do this in Linux Sendmail successfully?   Is 
> there a better way to do it these days in sendmail?   I setup the UNIX 
> stuff around 2006 and its been working ever since.   Maybe by use of a 
> milter?
>
Sure, use Postfix instead
>
> Please don't suggest we move to Postfix unless you know how to 
> accomplish the task described above in Postfix.
>

Oh man, that's not fair ;-)

look at the sender_dependent_relayhost_maps option in Postfix

For a simple example, you could have something like

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay_map

in main.cf, and then in /etc/postfix/sender_relay_map you have something 
like

billybob at mydomain1.com      [exchange.server.com]:25
billybob at otherdomain.com     [real.server.com]:25
@mydomain2.com                   [other.server.com]:587

(so billybob at mydomain1.com relays through exchange.server.com port 25 
and billybob at otherdomain.com relays through real.server.com port 25, and 
all users @mydomain2.com relay through other.server.com port 587)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130501/e70926cc/attachment.html>


More information about the Ale mailing list