> On 02 mai 2020, at 18:09, Bob Proulx <b...@proulx.com> wrote: > >> Unfortunately I've discovered that Amavisd is unable to add headers >> I want as it would do as an smtp proxy filter. >> It will properly add: >> >> X-Virus-Scanned: my custom tag >> X-Crm114-Status: UNSURE ( 6.79 ) > > Those two milters appear configured okay. Okay for CRM114 (which I > like and use as well). Okay for the virus scanner. You are seeing > the headers. That appears to be working okay. > >> but won't add: >> >> X-Spam-Score: -3.714 >> X-Spam-Flag: NO >> X-Spam-Level: >> X-Spam-Status: No, score=-3.714 tagged_above=-6 required=3 >> tests=[ALL_TRUSTED=-1, ... > > That milter configuration for SpamAssassin appears to have a problem > then. If the headers are not being added. Because conceptually it is > no different from the other two milters. But if that milter is not > able to add those headers then something is not right about that > configuration. If it were me I would keep working that part of the > problem. > >> I'm still wondering how it can add the X-Crm114-Status header >> (amavisd uses spamassassin and spamassassin uses crm114, quite far >> fetched) but seems unable to add it's own personalized headers. > > If this were the spamassassin users list I would challenge that > assertion because as far as I know SpamAssassin does not use CRM114. > SA has its own Bayes engine. Instead CRM114 would be running from > it's own configuration separately. I run CRM114 before SpamAssassin > and then add in custom SA rules to score a final SA score using CRM114 > as one of the weighted inputs, de-rating SA's internal Bayes to avoid > double scoring. But since this isn't the SpamAssassin users list I > will simply suggest gently that something is wrong with the milter > configuration for it interfacing to Postfix.
For clarity I'll share my new master.cf content (partial) here: --------------------------- IP.ADD.RE.SS:smtp inet n - n - 1 postscreen dnsblog unix - - n - 0 dnsblog tlsproxy unix - - n - 0 tlsproxy smtpd pass - - n - - smtpd -o smtpd_client_connection_count_limit=10 -o disable_mime_output_conversion=yes -o smtpd_milters=unix:/var/milter-greylist/milter-greylist.sock,inet:127.0.0.1:8891,inet:localhost:8893,unix:/var/run/amavis/amavisd-milter.sock -o non_smtpd_milters= policyd-spf unix - n n - 0 spawn user=nobody argv=/usr/local/bin/policyd-spf 127.0.0.1:smtp inet n - n - 5 smtpd -o smtpd_client_connection_count_limit=10 -o disable_mime_output_conversion=yes -o smtpd_milters=inet:127.0.0.1:8891,unix:/var/run/amavis/amavisd-milter.sock -o non_smtpd_milters=inet:127.0.0.1:8891,unix:/var/run/amavis/amavisd-milter.sock # # After-filter SMTP server. Receive mail from the content filter # on localhost port 10025. # 127.0.0.1:10025 inet n - n - - smtpd -o smtpd_authorized_xforward_hosts=127.0.0.0/8 -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_data_restrictions= -o mynetworks=127.0.0.0/8 -o receive_override_options=no_unknown_recipient_checks -o smtpd_milters= -o non_smtpd_milters= --------------------------- In addition to that, my main.cf reads: --------------------------- # grep milter main.cf milter_default_action = accept milter_connect_macros = j {client_name} {daemon_name} v milter_protocol = 6 smtpd_milters = inet:127.0.0.1:8891 non_smtpd_milters = inet:127.0.0.1:8891, unix:/var/run/amavis/amavisd-milter.sock --------------------------- So I'm using those milters: unix:/var/milter-greylist/milter-greylist.sock => greylisting inet:127.0.0.1:8891 => OpenDKIM inet:localhost:8893 => OpenDMARC unix:/var/run/amavis/amavisd-milter.sock => Amavisd-milter Amavisd-new runs as a daemon and handle spamassassin filtering. I've added a crm114 perl module to spamassassin so that I don't have anything to run on the side: # ls -1 /usr/local/etc/mail/spamassassin/crm114* /usr/local/etc/mail/spamassassin/crm114.cf /usr/local/etc/mail/spamassassin/crm114.pm X-Virus-Scanned and X-Crm114-Status are added by Amavisd-new, as every other X-Spam-* headers. patpro