> On Feb 26, 2017, at 12:26 PM, Marek Kozlowski <m.kozlow...@mini.pw.edu.pl> > wrote: > >>> smtp inet n - n - - smtpd >>> -o content_filter=spamassassin >>> -o receive_override_options=no_address_mappings >> >> Mail that comes in via SMTP is (initially) force-routed to the >> above specified content_filter transport. > > Can you explain more precisely what you mean by saying "(initially) > force-routed "?
The first time the message hits the queue (prior to re-injection). Since smtpd(8) added a content_filter setting to the queue file, normal transport selection is preƫmpted by the content filter. > According to my tests and logs it happens AFTER (the first invocation > of) the `cleanup' service. Of course, since the flow is smtpd(8) -> cleanup(8) -> incoming queue where qmgr(8) finds the message and schedules delivery via the appropriate agent. >>> Why does `qmgr' for the first time use `smtp' delivery agent >> >> It does not. It uses the content_filter transport if added upstream >> to the queue file, or otherwise whatever transport table or address >> class implies. > > But in the above configuration the `content_filter' is added only to > `smtp'..? No, the filter is added on *input* via SMTP, that is the "smtp inet" service provided by smtpd(8). Don't confuse input with output. * SMTP input: smtp inet ... smtpd * SMTP output: smtp unix ... smtp -- Viktor.