Re: Rule tag for _USERNAME_?

2021-03-14 Thread Dan Mahoney


> On Mar 14, 2021, at 9:45 PM, Kevin A. McGrail  wrote:
> 
> Well, SpamAssMilter *must* be capturing the data from spamc and creating that 
> header.  If you look at the cpp, it's building it.  You could change the 
> Milter to create a header called X-ImaMilter and use any data you want.

No argument there.  My point was that it’s not just checking it for ’normal’ 
spamassassin output (i.e. sanitizing the header returned to see if it matches 
any standard.  I can put anything i want in that header and (modulo length) it 
will transit through to my MTA’s logs.

> But it looks like signal_user_changed sets self->{username} in spamd so if 
> you want, try this small patch for PerMsgStatus and lmk.  I tested it locally 
> and it works.  It would need more documentation and cleanup to add it but 
> it's safe as a proof of concept:
> 
> Index: lib/Mail/SpamAssassin/PerMsgStatus.pm
> ===
> --- lib/Mail/SpamAssassin/PerMsgStatus.pm   (revision 1884910)
> +++ lib/Mail/SpamAssassin/PerMsgStatus.pm   (working copy)
> @@ -257,6 +257,11 @@
>my $pms = shift;
>$pms->{main}->timer_report();
>  },
> + 
> +USERNAME => sub {
> +  my $pms = shift;
> +  $pms->{main}->{username};
> +},
>  
>  ADDEDHEADERHAM => sub {
>my $pms = shift;

I’ll give that a try in the next day.  I’ve been down the rabbit hole on a 
different project.  People in this community will likely notice my efforts tho.

Thanks Kevin

-Dan



> 
> On Sun, Mar 14, 2021 at 7:10 AM Dan Mahoney  > wrote:
> 
> 
>> On Mar 13, 2021, at 7:51 PM, Kevin A. McGrail > > wrote:
>> 
>> Hi Dan,
>> 
>> Milters are the glue that change the email.  SpamAssassin is just giving 
>> data back to the milter.  
>> 
>> I believe you will find that X-Spam-Status header is being built by 
>> spamass-milter not by spamassasin.  You need to change the milter code to 
>> keep track of the user and add it to the X-Spam-Status line in the 
>> spamass-milter.cpp
> 
> That’s not true.
> 
> While it’s true that we’ve had issues getting spamass-milter to allow headers 
> OTHER than the standard spamassassin ones through, I can pack the info I want 
> in to the X-Spam-Status header.  Here’s an example of a recent mail:
> 
> X-Spam-Status: No, score=2.5 required=5.0 tests=DCC_CHECK=1.1,
>  DCC_REPUT_95_98=0.7,DKIM_INVALID=0.1,DKIM_SIGNED=0.1,
>  HAS_UNSUBSCRIBE=0.01,HTML_IMAGE_RATIO_04=0.001,HTML_MESSAGE=0.001,
>  ISC_UNDISCLOSED=0.01,KAM_DMARC_STATUS=0.01,KAM_EU=0.5,
>  SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=disabled version=3.4.4
>  Lang=fr ASN=AS3292 USER=_USERNAME_
> 
> This comes from SA's local.cf : 
> 
> local.cf:add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ 
> tests=_TESTSSCORES_ autolearn=_AUTOLEARN_ version=_VERSION_ Lang=_LANGUAGES_ 
> ASN=_ASN_ USER=_USERNAME_
> local.cf:add_header all Language _LANGUAGES_ (this one doesn’t show up)
> 
> See where I have _USERNAME_ being passed through as a bareword?  I would like 
> to have the LHS/RHS of whatever email address was used to pull up userprefs 
> in that field.
> 
> -Dan
> 
>> 
>> Regards,
>> KAM
>> --.
>> Kevin A. McGrail
>> Member, Apache Software Foundation
>> Chair Emeritus Apache SpamAssassin Project
>> https://www.linkedin.com/in/kmcgrail  
>> - 703.798.0171
>> 
>> 
>> On Fri, Jan 15, 2021 at 5:31 PM Dan Mahoney (Gushi) > > wrote:
>> All,
>> 
>> For dumb reasons, we at the day job are using spamass-milter, which 
>> doesn't seem to let SpamAssassin add any extra X-Spam-Foo:  message tags 
>> beyond stock (I have a github issue open on this, which seems to be 
>> where a fork is being maintained).
>> 
>> However, in order to work around this, I've added more tags to the 
>> X-Spam-Status tag locally.  Which is useful because it also lets me grep 
>> my maillogs for those things.
>> 
>> What I can't find, and it feels like it should be a thing, is the 
>> *username* for the tag.  That is to say, the username that's being used to 
>> find the user-prefs (in our case, with spamd, it's just %u, we don't have 
>> the user/domain stuff set up).
>> 
>> This *feels* like something a quick .pm file should be able to add rather 
>> than having to modify spamassassin core (and in fact, the tokens for 
>> username, mailbox and domain *are* available for the bayes_sql_query, but 
>> for some reason aren't exposed as tags that can be used in the report 
>> header.  Which feels somehow deliberate.)
>> 
>> Would this be easy to do?
>> 
>> It would also mean I could easily glean per-user/per-rule-hit reporting 
>> from my maillogs with a simple grep, rather than having to cross-correlate 
>> the mta logs from the spamd ones.  This feels like a win.
>> 
>> -Dan
>> 
>> -- 
>> 
>> 
>> Dan Mahoney
>> Techie,  Sysadmin,  WebGeek
>> Gushi on efnet/undernet 

Re: Rule tag for _USERNAME_?

2021-03-14 Thread Kevin A. McGrail
Well, SpamAssMilter *must* be capturing the data from spamc and creating
that header.  If you look at the cpp, it's building it.  You could change
the Milter to create a header called X-ImaMilter and use any data you want.

But it looks like signal_user_changed sets self->{username} in spamd so if
you want, try this small patch for PerMsgStatus and lmk.  I tested it
locally and it works.  It would need more documentation and cleanup to add
it but it's safe as a proof of concept:

Index: lib/Mail/SpamAssassin/PerMsgStatus.pm
===
--- lib/Mail/SpamAssassin/PerMsgStatus.pm   (revision 1884910)
+++ lib/Mail/SpamAssassin/PerMsgStatus.pm   (working copy)
@@ -257,6 +257,11 @@
   my $pms = shift;
   $pms->{main}->timer_report();
 },
+
+USERNAME => sub {
+  my $pms = shift;
+  $pms->{main}->{username};
+},

 ADDEDHEADERHAM => sub {
   my $pms = shift;


Regards,
KAM
--
Kevin A. McGrail
Member, Apache Software Foundation
Chair Emeritus Apache SpamAssassin Project
https://www.linkedin.com/in/kmcgrail - 703.798.0171


On Sun, Mar 14, 2021 at 7:10 AM Dan Mahoney  wrote:

>
>
> On Mar 13, 2021, at 7:51 PM, Kevin A. McGrail  wrote:
>
> Hi Dan,
>
> Milters are the glue that change the email.  SpamAssassin is just giving
> data back to the milter.
>
> I believe you will find that X-Spam-Status header is being built by
> spamass-milter not by spamassasin.  You need to change the milter code to
> keep track of the user and add it to the X-Spam-Status line in the
> spamass-milter.cpp
>
>
> That’s not true.
>
> While it’s true that we’ve had issues getting spamass-milter to allow
> headers OTHER than the standard spamassassin ones through, I can pack the
> info I want in to the X-Spam-Status header.  Here’s an example of a recent
> mail:
>
> X-Spam-Status: No, score=2.5 required=5.0 tests=DCC_CHECK=1.1,
>  DCC_REPUT_95_98=0.7,DKIM_INVALID=0.1,DKIM_SIGNED=0.1,
>  HAS_UNSUBSCRIBE=0.01,HTML_IMAGE_RATIO_04=0.001,HTML_MESSAGE=0.001,
>  ISC_UNDISCLOSED=0.01,KAM_DMARC_STATUS=0.01,KAM_EU=0.5,
>  SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=disabled version=3.4.4
>  Lang=fr ASN=AS3292 USER=_USERNAME_
>
> This comes from SA's local.cf:
>
> local.cf:add_header all Status _YESNO_, score=_SCORE_ required=_REQD_
> tests=_TESTSSCORES_ autolearn=_AUTOLEARN_ version=_VERSION_
> Lang=_LANGUAGES_ ASN=_ASN_ USER=_USERNAME_
> local.cf:add_header all Language _LANGUAGES_ (this one doesn’t show up)
>
> See where I have _USERNAME_ being passed through as a bareword?  I would
> like to have the LHS/RHS of whatever email address was used to pull up
> userprefs in that field.
>
> -Dan
>
>
> Regards,
> KAM
> --.
> Kevin A. McGrail
> Member, Apache Software Foundation
> Chair Emeritus Apache SpamAssassin Project
> https://www.linkedin.com/in/kmcgrail - 703.798.0171
>
>
> On Fri, Jan 15, 2021 at 5:31 PM Dan Mahoney (Gushi) 
> wrote:
>
>> All,
>>
>> For dumb reasons, we at the day job are using spamass-milter, which
>> doesn't seem to let SpamAssassin add any extra X-Spam-Foo:  message tags
>> beyond stock (I have a github issue open on this, which seems to be
>> where a fork is being maintained).
>>
>> However, in order to work around this, I've added more tags to the
>> X-Spam-Status tag locally.  Which is useful because it also lets me grep
>> my maillogs for those things.
>>
>> What I can't find, and it feels like it should be a thing, is the
>> *username* for the tag.  That is to say, the username that's being used
>> to
>> find the user-prefs (in our case, with spamd, it's just %u, we don't have
>> the user/domain stuff set up).
>>
>> This *feels* like something a quick .pm file should be able to add rather
>> than having to modify spamassassin core (and in fact, the tokens for
>> username, mailbox and domain *are* available for the bayes_sql_query, but
>> for some reason aren't exposed as tags that can be used in the report
>> header.  Which feels somehow deliberate.)
>>
>> Would this be easy to do?
>>
>> It would also mean I could easily glean per-user/per-rule-hit reporting
>> from my maillogs with a simple grep, rather than having to
>> cross-correlate
>> the mta logs from the spamd ones.  This feels like a win.
>>
>> -Dan
>>
>> --
>>
>>
>> Dan Mahoney
>> Techie,  Sysadmin,  WebGeek
>> Gushi on efnet/undernet IRC
>> FB:  fb.com/DanielMahoneyIV
>> LI:   linkedin.com/in/gushi
>> Site:  http://www.gushi.org
>> ---
>>
>>
>


Re: Can a .spamassassin directory in a user's home directory override the site-wide configuration?

2021-03-14 Thread Matus UHLAR - fantomas

On 14.03.21 08:36, Steve Dondley wrote:
I'm learning to understand how to properly set up a site-wide bayes 
database on my server. Thanks for everyone's help and patience so far.


I've discovered that the SA score assigned to a user's incoming email 
is different than the SA score run through the "spamc" or 
"spamassassin" command. For example, the SA headers for email "A" will 
show a score of only 1.4 (non-spam) in the user's inbox. It shows as 
non-span despite the fact that I have run it through sa-learn as spam. 
When I run the same email through "spamc -R < " on the 
command line as the same user that received the original message, I 
see a score of 6.8 and it is properly getting classified as spam.


I'm trying to determine what accounts for the different scores and fix 
this problem so the correct score is assigned to mail coming into the 
user's inbox.



After doing some investigating, I discovered the user still had a 
.spamassassin directory in their home directory. The directory has 
only a single "user_prefs" file. But I'm wondering if the existence of 
this directory might cause spamassassin filter to ignore site-wide 
bayes database. If that's not the problem, what might account for the 
different scores and how might I fix the issue?


spamassassin reads site-wide config, then users' ~/.spamassassin/user_prefs

spamd can do the same, if it runs under root without the '-x' flag (which
disables this behavior). 


spamc connects to spamd passing the username to it, so you can override
current user by passing the "-u username" flag to it.

--
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.
  One OS to rule them all, One OS to find them,
One OS to bring them all and into darkness bind them


Re: Problem with local.cf rules

2021-03-14 Thread jwmincy
John Hardin writes:
 > From: John Hardin 
 > Date: Sun, 14 Mar 2021 08:29:01 -0700 (PDT)
 > 
 > On Sun, 14 Mar 2021, jwmi...@gmail.com wrote:
 > 
 > > Peter West writes:
 > >
 > > And You might want to fix the URIBL_BLOCKED issue.  Fixing the
 > > URIBL_BLOCKED issue will do far more to fix your issues than adding
 > > rules.
 > 
 > Seconded. The keywords here are "local, caching, *NON-FORWARDING* DNS 
 > server for SpamAssassin".
 > 
 > If that isn't enough to set you on the right path, search the mailing list 
 > archives for "URIBL-BLOCKED" or "URIBL DNS" for previous discussions of 
 > this topic. If that history isn't enough, feel free to ask for assistance.

Yep - thanks for filling in the details.

Also, I forgot to mention - always do spammassassin --lint after
adding rules to check for syntax errors.

-jeff


Re: Problem with local.cf rules

2021-03-14 Thread John Hardin

On Sun, 14 Mar 2021, jwmi...@gmail.com wrote:


Peter West writes:

And You might want to fix the URIBL_BLOCKED issue.  Fixing the
URIBL_BLOCKED issue will do far more to fix your issues than adding
rules.


Seconded. The keywords here are "local, caching, *NON-FORWARDING* DNS 
server for SpamAssassin".


If that isn't enough to set you on the right path, search the mailing list 
archives for "URIBL-BLOCKED" or "URIBL DNS" for previous discussions of 
this topic. If that history isn't enough, feel free to ask for assistance.


--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.org pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  Failure to plan ahead on someone else's part does not constitute
  an emergency on my part. -- David W. Barts in a.s.r
---
 Today: Daylight Saving Time begins in U.S. - Spring Forward


Re: Problem with local.cf rules

2021-03-14 Thread John Hardin

On Mon, 15 Mar 2021, Peter West wrote:


Well, that was simple. Thank you. What’s the default value of a rule? Does it 
have one?


The default score for all rules is 1 point.


--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.org pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  Failure to plan ahead on someone else's part does not constitute
  an emergency on my part. -- David W. Barts in a.s.r
---
 Today: Daylight Saving Time begins in U.S. - Spring Forward

Re: Problem with local.cf rules

2021-03-14 Thread jwmincy
Peter West writes:
 > From: Peter West 
 > Date: Sun, 14 Mar 2021 23:30:03 +1000
 > 
 > I m running spamassassin 3.4.2-0 in ubuntu 18.04.4.
 > 
 > Controlling process is
 > /usr/bin/perl -T -w /usr/sbin/spamd -d --pidfile=/var/run/spamd.pid 
 > --create-prefs --max-children 5 --helper-home-dir
 > 
 > 
 > My local.cf has local rules enabled, and contains, inter alia, these rules
 > =
 > 
 > header CASINO From =~ /\bcasino\b/i
 > score 100.0
 > 
 > header CASINOS From =~ /\bcasinos\b/i
 > score 100.0

These two rules can be combined by making the 's' optional eg 's?'

 > The casinao stuff is still getting through. Here s the X-Spam-Status on a 
 > typical message.
 > 
 > X-Spam-Status: No, score=4.1 required=5.0 
 > tests=CASINO,DKIM_SIGNED,DKIM_VALID,
 >  DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RAZOR2_CF_RANGE_51_100,
 >  RAZOR2_CHECK,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED shortcircuit=no
 >  autolearn=no autolearn_force=no version=3.4.2
 > 
 > It s hitting the CASINO rule, but no matter what valoue I assign to the 
 > casino rules - 5, 20 , 100, these messages always come through with a value 
 > of 4.1. It s as though some toerh rule is resetting the score to 0 before 
 > proceeding.
 > 
 > My other query concerns the AUSPOST rules. What I want to do is elminate 
 > mail that has a name of  AUSTRALIA POST  and does NOT have an address 
 > containing . Hence I m trying the -20.0 +20.0 pair of rules. 
 > Is there a more direct way of achieving this? Will a pcre  not followed by  
 > style of rule do the trick?
 > 
 > Is there a finer subdivision of the From header; into name and address, for 
 > example.
 > 
 > peter
 > 
 >  
 > p...@ehealth.id.au
 >  Two men went up into the temple to pray, one a Pharisee and the other a tax 
 > collector. 


Change the Status header to show the scores for each rule, by changing
tests=_TESTS_ to tests=_TESTSSCORES_
Something like: 
   add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ 
tests=_TESTSSCORES_ version=_VERSION_ autolearn=_AUTOLEARN_

This will show the score that you are getting for CASINO, which is
probably 1, because of the syntax error in your scores (already
pointed out).


And You might want to fix the URIBL_BLOCKED issue.  Fixing the
URIBL_BLOCKED issue will do far more to fix your issues than adding
rules.


-jeff


Re: Problem with local.cf rules

2021-03-14 Thread Peter West
Well, that was simple. Thank you. What’s the default value of a rule? Does it 
have one?
—
p...@ehealth.id.au
“Two men went up into the temple to pray, one a Pharisee and the other a tax 
collector.”

> On 14 Mar 2021, at 11:41 pm, Alex Woick  wrote:
> 
> Peter West schrieb am 14.03.2021 um 14:30:
>> header CASINO From =~ /\bcasino\b/i
>> score 100.0
>> 
>> ===
>> 
>> 
>> It’s hitting the CASINO rule, but no matter what valoue I assign to the 
>> casino rules - 5, 20 , 100, these messages always come through with a value 
>> of 4.1. It’s as though some toerh rule is resetting the score to 0 before 
>> proceeding.
> You need to tell the rule name with the score keyword, otherwise spamassassin 
> cannot know to which rule it should set the score.
> 
> score CASINO 100
> 



Re: Problem with local.cf rules

2021-03-14 Thread Alex Woick

Peter West schrieb am 14.03.2021 um 14:30:

header CASINO From =~ /\bcasino\b/i
score 100.0

===


It’s hitting the CASINO rule, but no matter what valoue I assign to the casino 
rules - 5, 20 , 100, these messages always come through with a value of 4.1. 
It’s as though some toerh rule is resetting the score to 0 before proceeding.
You need to tell the rule name with the score keyword, otherwise 
spamassassin cannot know to which rule it should set the score.


score CASINO 100



Problem with local.cf rules

2021-03-14 Thread Peter West
I’m running spamassassin 3.4.2-0 in ubuntu 18.04.4.

Controlling process is
/usr/bin/perl -T -w /usr/sbin/spamd -d --pidfile=/var/run/spamd.pid 
--create-prefs --max-children 5 --helper-home-dir


My local.cf has local rules enabled, and contains, inter alia, these rules
=

header CASINO From =~ /\bcasino\b/i
score 100.0

header CASINOS From =~ /\bcasinos\b/i
score 100.0

header CASINO_DONOVAN From =~ /\bray donovan\b/i
score 100.0

header CASINO_OLIVIA From =~ /\bolivia.*cs\b/i
score 100.0

header BAD_WORDS_1 From =~ 
/\b(swimming|solarbank|bag|intelligent|napkin|stretcher)\b/i
score 6.0

header BAD_WORDS_2 From =~ 
/\b(smart|amazing|clavicle|slicer|indestructible|bamboo)\b/i
score 6.0

header BAD_WORDS_3 From =~ 
/\b(innovation|selfie|socks|healthreporters|thermovest)\b/i
score 6.0

header BAD_WORDS_4 From =~ 
/\bdrone\b|\bremover\b|\btrainer\b|\btactical\b|\bsmart watch\b/i
score 6.0

header BAD_WORDS_5 From =~ /(\blost\b.*[0-9]+.*lbs\b)/i
score 10.0

header BAD_WORDS_6 From =~ /\bdrone\b|\bprofessional\b|\bslim\b|\bmini\b/i

header AUSPOST_GOOD From =~ /auspost\.com\.au/
score -20.0

header AUSPOST_BAD From =~ /Australia Post/
score 20.0
===

The casinao stuff is still getting through. Here’s the X-Spam-Status on a 
typical message.

X-Spam-Status: No, score=4.1 required=5.0 tests=CASINO,DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RAZOR2_CF_RANGE_51_100,
RAZOR2_CHECK,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED shortcircuit=no
autolearn=no autolearn_force=no version=3.4.2

It’s hitting the CASINO rule, but no matter what valoue I assign to the casino 
rules - 5, 20 , 100, these messages always come through with a value of 4.1. 
It’s as though some toerh rule is resetting the score to 0 before proceeding.

My other query concerns the AUSPOST rules. What I want to do is elminate mail 
that has a name of “AUSTRALIA POST” and does NOT have an address containing 
. Hence I’m trying the -20.0 +20.0 pair of rules. Is there a 
more direct way of achieving this? Will a pcre ’not followed by’ style of rule 
do the trick?

Is there a finer subdivision of the From header; into name and address, for 
example.

peter

—
p...@ehealth.id.au
“Two men went up into the temple to pray, one a Pharisee and the other a tax 
collector.”



Can a .spamassassin directory in a user's home directory override the site-wide configuration?

2021-03-14 Thread Steve Dondley
I'm learning to understand how to properly set up a site-wide bayes 
database on my server. Thanks for everyone's help and patience so far.


I've discovered that the SA score assigned to a user's incoming email is 
different than the SA score run through the "spamc" or "spamassassin" 
command. For example, the SA headers for email "A" will show a score of 
only 1.4 (non-spam) in the user's inbox. It shows as non-span despite 
the fact that I have run it through sa-learn as spam. When I run the 
same email through "spamc -R < " on the command line as 
the same user that received the original message, I see a score of 6.8 
and it is properly getting classified as spam.


I'm trying to determine what accounts for the different scores and fix 
this problem so the correct score is assigned to mail coming into the 
user's inbox.



After doing some investigating, I discovered the user still had a 
.spamassassin directory in their home directory. The directory has only 
a single "user_prefs" file. But I'm wondering if the existence of this 
directory might cause spamassassin filter to ignore site-wide bayes 
database. If that's not the problem, what might account for the 
different scores and how might I fix the issue?


Re: Rule tag for _USERNAME_?

2021-03-14 Thread Dan Mahoney


> On Mar 13, 2021, at 7:51 PM, Kevin A. McGrail  wrote:
> 
> Hi Dan,
> 
> Milters are the glue that change the email.  SpamAssassin is just giving data 
> back to the milter.  
> 
> I believe you will find that X-Spam-Status header is being built by 
> spamass-milter not by spamassasin.  You need to change the milter code to 
> keep track of the user and add it to the X-Spam-Status line in the 
> spamass-milter.cpp

That’s not true.

While it’s true that we’ve had issues getting spamass-milter to allow headers 
OTHER than the standard spamassassin ones through, I can pack the info I want 
in to the X-Spam-Status header.  Here’s an example of a recent mail:

X-Spam-Status: No, score=2.5 required=5.0 tests=DCC_CHECK=1.1,
 DCC_REPUT_95_98=0.7,DKIM_INVALID=0.1,DKIM_SIGNED=0.1,
 HAS_UNSUBSCRIBE=0.01,HTML_IMAGE_RATIO_04=0.001,HTML_MESSAGE=0.001,
 ISC_UNDISCLOSED=0.01,KAM_DMARC_STATUS=0.01,KAM_EU=0.5,
 SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=disabled version=3.4.4
 Lang=fr ASN=AS3292 USER=_USERNAME_

This comes from SA's local.cf: 

local.cf:add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ 
tests=_TESTSSCORES_ autolearn=_AUTOLEARN_ version=_VERSION_ Lang=_LANGUAGES_ 
ASN=_ASN_ USER=_USERNAME_
local.cf:add_header all Language _LANGUAGES_ (this one doesn’t show up)

See where I have _USERNAME_ being passed through as a bareword?  I would like 
to have the LHS/RHS of whatever email address was used to pull up userprefs in 
that field.

-Dan

> 
> Regards,
> KAM
> --.
> Kevin A. McGrail
> Member, Apache Software Foundation
> Chair Emeritus Apache SpamAssassin Project
> https://www.linkedin.com/in/kmcgrail  - 
> 703.798.0171
> 
> 
> On Fri, Jan 15, 2021 at 5:31 PM Dan Mahoney (Gushi)  > wrote:
> All,
> 
> For dumb reasons, we at the day job are using spamass-milter, which 
> doesn't seem to let SpamAssassin add any extra X-Spam-Foo:  message tags 
> beyond stock (I have a github issue open on this, which seems to be 
> where a fork is being maintained).
> 
> However, in order to work around this, I've added more tags to the 
> X-Spam-Status tag locally.  Which is useful because it also lets me grep 
> my maillogs for those things.
> 
> What I can't find, and it feels like it should be a thing, is the 
> *username* for the tag.  That is to say, the username that's being used to 
> find the user-prefs (in our case, with spamd, it's just %u, we don't have 
> the user/domain stuff set up).
> 
> This *feels* like something a quick .pm file should be able to add rather 
> than having to modify spamassassin core (and in fact, the tokens for 
> username, mailbox and domain *are* available for the bayes_sql_query, but 
> for some reason aren't exposed as tags that can be used in the report 
> header.  Which feels somehow deliberate.)
> 
> Would this be easy to do?
> 
> It would also mean I could easily glean per-user/per-rule-hit reporting 
> from my maillogs with a simple grep, rather than having to cross-correlate 
> the mta logs from the spamd ones.  This feels like a win.
> 
> -Dan
> 
> -- 
> 
> 
> Dan Mahoney
> Techie,  Sysadmin,  WebGeek
> Gushi on efnet/undernet IRC
> FB:  fb.com/DanielMahoneyIV 
> LI:   linkedin.com/in/gushi 
> Site:  http://www.gushi.org 
> ---
>