[CentOS] sendmail routing

Les Mikesell lesmikesell at gmail.com
Wed Sep 2 19:02:40 UTC 2009


Hugh E Cruickshank wrote:
> From: Christopher Chan Sent: September 1, 2009 23:04
>>> 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.m4
> 
> While this does look promising I am hesitant to install anything that
> is either a) possibly version dependent and b) beyond my understanding
> as to what it is doing. I will have to review this thoroughly before
> I even consider implementing it.
> 
>> I have not tested it let alone tried on 8.14.x
> 
> Caveat noted.
> 
>> I cannot believe the file is dated 2004. Ah well, I got rid of
>> sendmail and replaced it with postfix in 2003 while I was still a
>> mail admin. I must bow to the real sendmail bigots.
> 
> Mail administration is just one of those "little" jobs that I am
> responsible for and I just have not had the time to review/learn a
> new MTA so I muddle on with the "devil I know".
> 
> Thanks for your suggestion it has definitely given me something to
> think on and possibly work with.

As 'yet another way' that might work...  You could set SMART_HOST to a 
name that has multiple MX entries in DNS, so everything will attempt to 
relay through the one with the lowest priority.   On that box you could 
install a sendmail milter that would tmp_fail messages from senders in 
the domain you want the other relay to handle with a 4xx response.  That 
should make the originating sendmail immediately retry the next-lowest 
priority MX address which would be the server you want these to use. 
The down side (besides not having tested it) would be that user agents 
configured to send directly to the 1st MX wouldn't know how to handle 
the rejection.

MimeDefang is a good addition to sendmail because it has an efficient 
design and code for most milter operations you might need.  You just 
write a small snippet of perl to control it and do any custom 
operations.  For example, it has a 'filter_sender' hook where you could 
easily reject or tmp_fail based on the sender's domain.  Hmmm, I guess 
you could do that in the access file with a custom error too - but 
mimedefang lets you think in perl instead of sendmail macros.

-- 
   Les Mikesell
     lesmikesell at gmail.com



More information about the CentOS mailing list