Page 1 of 1

Can't add relay-country header to all messages...

Posted: 22 May 2020 17:40
by iandarke
File: /etc/MailScanner/spam.assassin.prefs.conf

Content added to end:

Code: Select all

ifplugin Mail::SpamAssassin::Plugin::RelayCountry

header          RELAYCOUNTRY_BAD X-Relay-Countries =~ /^(CN|RU|DE)/
describe        RELAYCOUNTRY_BAD Testing country relay plugin
score           RELAYCOUNTRY_BAD 0.1
add_header all Relay-Country _RELAYCOUNTRY_

endif # Mail::SpamAssassin::Plugin::RelayCountry

I restarted spamassassin and mailscanner, but I was expecting to see something like this in my mail headers:

X-Spam-Relay-Country: US CN RU

It doesn't seem like headers are being added, but I did spot this in a recent spam so I know the rule is working (although for some reason the description isn't??)

Code: Select all

0.79	RDNS_NONE	Delivered to internal network by a host with no rDNS
0.10	RELAYCOUNTRY_BAD	 
0.00	SPF_HELO_NONE	SPF: HELO does not publish an SPF Record
I think my spamassassin configuration is correct and I'm *guessing* that something else in the spam processing chain is effecting the headers.


Sources:
https://cwiki.apache.org/confluence/dis ... ntryPlugin
viewtopic.php?t=1556

Re: Can't add relay-country header to all messages...

Posted: 23 May 2020 05:56
by pdwalker
iandarke wrote: 22 May 2020 17:40It doesn't seem like headers are being added, but I did spot this in a recent spam so I know the rule is working (although for some reason the description isn't??)
Tools and Links, Update SpamAssassin Rule Descriptions.

That should fix that problem.

Re: Can't add relay-country header to all messages...

Posted: 23 May 2020 19:40
by iandarke
Thanks.

Does anyone have any suggestions for where to look to get the extra header to be included? I think I'm creating it properly, but I'm guessing some later technology in the pipeline is removing it...?

Re: Can't add relay-country header to all messages...

Posted: 23 May 2020 20:13
by shawniverson
I think it is the way mailscanner calls spamassassin. I'll take a look.

Re: Can't add relay-country header to all messages...

Posted: 06 Apr 2021 14:56
by ericcox
iandarke, did you ever figure out what was happening? I think I may have the same problem: viewtopic.php?f=19&t=4702&p=17702#p17702

It's as if mailscanner hands off the message to spamassassin, spamassassin adds all the correct headers, but then mailscanner either strips out those headers or simply uses the original, unmodified message.

Re: Can't add relay-country header to all messages...

Posted: 13 Apr 2021 00:06
by iandarke
I gave up on the issue and assumed it was getting stripped later on as your analysis indicates.