Re: Check equal headers

2019-05-20 Thread Giovanni Bechis
On 5/21/19 3:48 AM, Jari Fredriksson wrote:
> 
> 
>> Giovanni Bechis  kirjoitti 20.5.2019 kello 17.00:
>>
>> Hi,
>> in a rule I would like to check if "From:" != "Reply-To:", is this possible 
>> without writing any code or should I add a new function in HeaderEval ?
>> Thanks & Cheers
>>  Giovanni
>>
> 
> Hello!
> 
> I have this in my /etc/spamassassin/local-rules.cf
> 
[...]
> header __FROM_V_REPLY   eval:check_for_from_v_replyto_dom()
>
warn: rules: error: unknown eval 'check_for_from_v_replyto_dom' for 
__FROM_V_REPLY
Do you have some custom code maybe ?
Anyway I wrote what I have in mind in a different way, thanks.
http://svn.apache.org/viewvc/spamassassin/trunk/rulesrc/sandbox/gbechis/20_freemail.cf?view=diff&r1=1859609&r2=1859610&pathrev=1859610

 Thanks & Cheers
  Giovanni


Re: Check equal headers

2019-05-20 Thread Jari Fredriksson



> Giovanni Bechis  kirjoitti 20.5.2019 kello 17.00:
> 
> Hi,
> in a rule I would like to check if "From:" != "Reply-To:", is this possible 
> without writing any code or should I add a new function in HeaderEval ?
> Thanks & Cheers
>  Giovanni
> 

Hello!

I have this in my /etc/spamassassin/local-rules.cf

header __FROM_EQ_TO eval:check_for_from_equals_to()
meta L_FROM_EQUALS_TO   !(ALL_TRUSTED || DKIM_VERIFIED) && __FROM_EQ_TO
describe L_FROM_EQUALS_TO   From: and To: have the same username
score L_FROM_EQUALS_TO  1.0

header __FROM_V_REPLY   eval:check_for_from_v_replyto_dom()
header __PREC_BULK  Precedence =~ /bulk|list/
meta L_FROM_NOT_REPLY !(__PREC_BULK||ALL_TRUSTED||DKIM_VERIFIED) && 
__FROM_V_REPLY
describe L_FROM_NOT_REPLY   From: and Reply-To: have different domains
score L_FROM_NOT_REPLY  1.0

Br. Jarif

Check equal headers

2019-05-20 Thread Giovanni Bechis
Hi,
in a rule I would like to check if "From:" != "Reply-To:", is this possible 
without writing any code or should I add a new function in HeaderEval ?
 Thanks & Cheers
  Giovanni


Re: LOCALPART_IN_SUBJECT does not hit

2019-05-20 Thread RW
On Mon, 20 May 2019 11:57:42 +0200
Tobi  wrote:

> Hi list
> 
> We have the case that the LOCALPART_IN_SUBJECT rule should match upon
> a message, but it doesn't. After checking the message we found that
> if we replace the UTF8 encoded subject header with a plain ascii
> containing the relevant string for LOCALPART_IN_SUBJECT it suddenly
> matches.
> 
> > Subject: =?utf-8?B?...?=  
> 
> and localpart name.firstname cannot be found in subject
> 
> but if we change
> 
> > Subject: [Reminder] name.firstname Your email will  
> 
> the localpart is found in subject.

It shouldn't be. LOCALPART_IN_SUBJECT matches the localpart in the
subject only in very specific formats.

If I run the above Subject header and a matching To header though SA

$ printf 'Subject: ...\nTo: name.firstn...@example.com\n' |
spamassassin | grep LOCALPART_IN_SUBJECT

I get no match. 


LOCALPART_IN_SUBJECT does not hit

2019-05-20 Thread Tobi
Hi list

We have the case that the LOCALPART_IN_SUBJECT rule should match upon a
message, but it doesn't. After checking the message we found that if we
replace the UTF8 encoded subject header with a plain ascii containing
the relevant string for LOCALPART_IN_SUBJECT it suddenly matches.

> Subject: =?utf-8?B?...?=

and localpart name.firstname cannot be found in subject

but if we change

> Subject: [Reminder] name.firstname Your email will

the localpart is found in subject.

We're using spamassassin 3.4.2 on CentOS 7.

We had to redact the subject and localpart for this report as they
contain customers personal details.

--

tobi