Formatting of SA score in Subject?

Jeff Morris jeffm859 at nullmodem.org
Wed Sep 28 08:54:12 CEST 2016


On 9/18/2016 8:32 AM, @lbutlr wrote:
> On Fri Sep 16 2016 01:22:20 Jeff Morris	<jeffm859 at nullmodem.org> said:
>> On 9/12/2016 4:15 PM, Jeff Morris wrote:
>>> On 9/4/2016 7:22 AM, @lbutlr wrote:
>>>> On 01 Sep 2016, at 13:18, Jeff Morris <jeffm859 at nullmodem.org> wrote:
>>>>>     $sa_spam_subject_tag = sprintf( "[SPAM: %06.3f]", _SCORE_ );
>>>>>
>>>>> Or is there a better way to do what I want? Maybe there's a token like _ZSCORE_ ? :-)
>>>> Close.
>>>>
>>>>          _SCORE(PAD)_      message score, if PAD is included and is either spaces or
>>>>                            zeroes, then pad scores with that many spaces or zeroes
>>>>                            (default, none)  ie: _SCORE(0)_ makes 2.4 become 02.4,
>>>>                            _SCORE(00)_ is 002.4.  12.3 would be 12.3 and 012.3
>>>>                            respectively.
>>>>
>>>> _SCORE(0)_ will pad with 0’s and _SCORE( )_ will pad with spaces
>>> Thank you! I'm not sure how I missed that when I looked for it, but indeed, that works like a charm.
>> Sigh. Well, it would appear that I spoke too soon. I *thought* it was working like a charm; turns out I was looking at already delivered spam on which I had already run a search and replace on the spam tag to make it sortable. When I went back and looked at my spam folder again today I realized that on new incoming spam, Amavisd is actually tagging with the literal string "_SCORE(0)_". So for some reason, Amavisd doesn't recognize this padded version of score for me. Was this a feature only added recently perhaps? I'm running Centos7, using the amavisd-new-2.10.1-5 rpm. Any other way to do this?
> The _SCORE(PAD)_ is a spamassassin setting, not an amavis setting. Where are you setting it?

In amavisd.conf. The following was from my original question, looks like 
it got snipped from the quotes above, sorry. I thought that things like 
this had to be set in amavisd.conf, because amavis' config would 
override spamassassin's own?

---

I currently have the following line in my amavisd.conf:

     $sa_spam_subject_tag = '[SPAM: _SCORE_] ';

I'd just like to tweak the score format here so it has a leading zero. 
(This way in my email client I can go into my spam folder, click on the 
subject header and get the mailbox sorted by score, so I can peruse the 
low-scoring messages for possible false-positives/ham.)

Can I change this to something like the following? Or is the _SCORE_ 
token getting parsed by something outside of Perl?

     $sa_spam_subject_tag = sprintf( "[SPAM: %06.3f]", _SCORE_ );

Or is there a better way to do what I want? Maybe there's a token like 
_ZSCORE_ ?



More information about the amavis-users mailing list