[Mimedefang] Relayed emails can't be filter!

Bill Cole mdlist-20140424 at billmail.scconsult.com
Thu Jun 12 18:44:30 EDT 2014

On 12 Jun 2014, at 12:26, Cương Bùi wrote:

> Hi everyone,
> I'm really stuck here. I configure my sendmail server using
> smarttable 
> (http://jmaimon.com/sendmail/anfi.homeunix.net/sendmail/smarttab.html)
> and smart_host feature for routing to different smtp servers, users.
> All local emails (sm-mta process) are caught in mimedefang filter. It 
> means I can process
> it in filter_* routines.
> ===
> Jun 12 14:39:17 srv-01 sm-mta[6520]: s5CEdHes006520: 
> from=</someuser at localhost/>, size=2461, class=0, nrcpts=1, 
> msgid=<1793922844.1402583957445>, proto=ESMTP, daemon=MTA-v4, 
> relay=localhost []
> ===
> And, all outgoing relayed emails (sendmail process) are not caught. It 
> means I do not "see" it in
> filter_* routines.
> ===
> Jun 12 14:40:20 srv-01 sendmail[6552]: STARTTLS=client, 
> relay=/smtp.outside.com/, version=TLSv1/SSLv3, verify=OK, 
> cipher=DHE-RSA-AES256-SHA, bits=256/256
> Jun 12 14:40:21 srv-01 sendmail[6552]: 1983T66ee00000001: 
> to=</abc at example.com/>, delay=00:01:04, xdelay=00:00:04, mailer=relay, 
> pri=0, relay=/smtp.outside.com/. [/], dsn=2.0.0, stat=Sent 
> (Ok: queued as 296B68067B)
> ===

I believe your pointless excessive munging has made these fake log lines 
misleading and useless, as well as incomplete. I'm ignoring them 
entirely because they appear to be full of lies :) It also seems like 
either your Sendmail is nothing like normal OR you have no idea how mail 
is flowing through it.

A *normal* sendmail configuration has 2 independently configured 
subsystems: the MSA that handles local submissions and the MTA that 
handles incoming mail from the world *AND* is used as a relay for all 
outbound mail by the MSA. Sendmail processes started as part of the MSA 
log as "sendmail" which those spawned by the main MTA daemon log as 
"sm-mta". A locally submitted message will generate at least 4 log lines 
(2 by each subsystem) and possibly an additional line from the MTA 
noting the TLS initiation.

Because the MSA passes all mail to the MTA, the submit.cf file that it 
uses (instead of sendmail.cf) is very simple and the .mc to build it 
almost never needs changing from distribution defaults. It should 
certainly not get routing hacks like smarttable added.

> Please help me out. I dont know how to solve this.

Make sure you have a pristine submit.mc which is unchanged from the 
Sendmail distribution package, and rebuild submit.cf from it. Make sure 
your sendmail.mc has both the Milter related configurations you need for 
mimedefang and the 'feature' line for smarttable. Rebuild sendmail.cf 
from that file. Restart sendmail.

More information about the MIMEDefang mailing list