[CentOS] sendmail routing

Christopher Chan christopher.chan at bradbury.edu.hk
Wed Sep 2 07:32:38 UTC 2009


John R Pierce wrote:
> Christopher Chan wrote:
>   
>>> Sorry, last I checked, there is no sender-based routing support in 
>>> sendmail. You cannot even try to create rulesets to get that.
>>>
>>>   
>>>     
>>>       
>> Looks like it is my turn to eat humble pie. You will need to rebuild 
>> sendmail.cf after applying this hack.
>>
>> http://www.cs.niu.edu/~rickert/cf/hack/sender_based_routing.m
>>     
>
> I note the comments on that patch talk about from: sender at host  rather 
> than sender at domain ... so, its possible it triggers on the host that the 
> sender is using rather than the domain in the 'from' header.
>
>
>   
You missed this part:

dnl # If the sender address/domain is as given, then that relay will be
dnl # chosen for the message.  If the sender address $f has no
dnl # "@domain" component, then $j is used.


It triggers on the domain. If there is no domain, the local hostname is 
appended before being checked against the mailertable. At least, that is 
how I read the comments. As for the rulesets below... at _@
> ugh, i used to know what ...
>
> R$+ <@ $+ >		$:$&f@$j<>$1<@$2>		prepend local sender
> R$+@$+@$j<>$+<@$+>	$:$1@$2<>$3<@$4>		avoid duplicate domain
> R$+@$+<>$+<@$+>		$:$(mailertable From:$1@$2 $:@$2 $)<>$3<@$4>
> R$*@$+.$+<>$+<@$+>	$:$(mailertable From:$2.$3 $@$1 $:$1$2 at .$3 $)<>$4<@$5>
> R$*@$+<>$+<@$+>		$:$(mailertable From:$2 $@$1 $: $)<>$3<@$4>
> R$-:$+<>$+		$@$>MailerToTriple <$1 : $2> $3
> R$*<>$+<$+>		$:$2 <$3>
>
>
>
>
> would do, but I'll be damned if I remember how that .cf stuff works 
> anymore   :rofl:
>
>   

A beer to anyone who can still remember how sendmail rulesets work after 
one month of being away from the stuff!



More information about the CentOS mailing list