On 24.01.23 23:09, Jaroslaw Rafa wrote:
No. The Postfix documentation says:
non_smtpd_milters (default: empty)
A list of Milter (mail filter) applications for new mail that does not
arrive via the Postfix smtpd(8) server. This includes local submission via
the sendmail(1) command line, new mail that arrives via the Postfix qmqpd(8)
server, and old mail that is re-injected into the queue with "postsuper -r".
Specify space or comma as a separator. See the MILTER_README document for
details.
So, if a message arrives via smtpd, and is processed via smtpd_milters, when
it goes further to cleanup, it is not processed by any more milters. Only
messages that go to cleanup with omission of smtpd are processed by
non_smtpd_milters.
So smtpd_milters and non_smtpd_milters are mutually exclusive; either one or
the other set of milters is run. Unless you use post-queue filtering and
re-inject mail back into Postfix after being filtered; then it is processed
again by non_smtpd_milters.
You are right. The milter is called twice, because a FILTER
(spamassassin in this case) is applied, after which the message is
re-injected using pickup, which triggeres the second milter run during
cleanup. (Still, I think the graphic on the MILTER page could be
improved :-))
I guess the best way to combat this would be to use spamassassin as a
milter as well?
Or do you have another idea?
(Maybe configuring a special cleanup instance which has
non_smtpd_milters= set for pickup using cleanup_service_name?)
Thanks!
Yannik