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?

This is fine for mail incoming via port 25 from other mail servers.
If you do this for mail from your clients, they will complain that sending e-mail takes too long (SA scanning may take some time). Therefore I use post-queue filter for mail received from internal/authenticated clients.

Or do you have another idea?
(Maybe configuring a special cleanup instance which has non_smtpd_milters= set for pickup using cleanup_service_name?)

On 25.01.23 01:48, Matus UHLAR - fantomas wrote:
This is usually done by feeding mail from post-queeue filter via special port where milters are not running via:
 -o receive_override_options=no_milters
(usually no_address_mappings too).

On 25.01.23 08:33, Yannik Sembritzki wrote:
I see your point and had a good look at the documentation of both spamassassin and rspamd: Both only seem to support integration as a milter, or with delivery to e.g. sendmail command. But no re-injection via smtp to a local port, which has a smtpd with these options applied running.

I forgot to mention I use amavisd-new because of these reasons.

To be more precise, when receiving mail from internet on port 25, I prefer amavisd-milter talking to amavisd so we can reject mail immediately, while clients from port 465/587 talk to amavisd-new using LMTP and amavisd-new injects mail back via LMTP on alternative port.

in some networks, even port 25 from LAN goes via LMTP to amavisd-new, and port 25 from the world is redirected onto other port with postscreen and milter.
--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
(R)etry, (A)bort, (C)ancer

Reply via email to