You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Philip Prindeville <ph...@redfish-solutions.com> on 2006/10/20 04:55:25 UTC

Re: How to whitelist_from <> ?

Matt Kettler wrote:

>Philip Prindeville wrote:
>  
>
>>There's no way to whitelist just the empty address then?  Rather than
>>everything?
>>
>>-Philip
>>
>>  
>>    
>>
>Not given the simple file-glob format of the whitelist commands. You'd
>need a regular expression and negation.
>
>You could do it with a rule...
>
>header __NULL_RETURN   From !~   /./i
>header __RCVD_MYHOST   Received =~ /<insert Received header regex
>matching your servers exchanging..>/
>meta MY_NULL_RETURN   (__NULL_RETURN && __RCVD_MYHOST)
>
>
>  
>

It's not the From, but rather the EnvelopeFrom.

--- Mail/SpamAssassin/Conf/Parser.pm.bak        2006-08-29 09:16:46.000000000 -0600
+++ Mail/SpamAssassin/Conf/Parser.pm    2006-10-19 20:44:18.000000000 -0600
@@ -631,6 +631,10 @@
   unless (defined $value && $value !~ /^$/) {
     return $Mail::SpamAssassin::Conf::MISSING_REQUIRED_VALUE;
   }
+  # email from postmaster, abuse autoresponders, etc.
+  if ($value eq '<>') {
+    return $conf->{parser}->add_to_addrlist ($key, '');
+  }
   $conf->{parser}->add_to_addrlist ($key, split (' ', $value));
 }


I tried the above fix, but it didn't work.

Not sure why...

-Philip




Re: How to whitelist_from <> ?

Posted by Matt Kettler <mk...@verizon.net>.
Philip Prindeville wrote:
> Matt Kettler wrote:
>
>   
>> Philip Prindeville wrote:
>>  
>>
>>     
>>> Matt Kettler wrote:
>>>
>>>
>>>       
>>>>> Not given the simple file-glob format of the whitelist commands. You'd
>>>>> need a regular expression and negation.
>>>>>
>>>>> You could do it with a rule...
>>>>>
>>>>> header __NULL_RETURN   From !~   /./i
>>>>> header __RCVD_MYHOST   Received =~ /<insert Received header regex
>>>>> matching your servers exchanging..>/
>>>>> meta MY_NULL_RETURN   (__NULL_RETURN && __RCVD_MYHOST)
>>>>>
>>>>>      
>>>>>
>>>>>           
>>> It's not the From, but rather the EnvelopeFrom.
>>>   
>>>
>>>       
>> A rule matching "header From" should match any "from like" header,
>> including Return-Path.
>>  
>>
>>     
>
> Not sure I follow.
>
> The From: header will be <ma...@foo.bar> or <po...@foo.bar>
> or something similar (depending on the agent).
>
> The Sender (EnvelopeFrom will be empty, however).  I believe that MdF
> sticks that into the ReturnPath: header.
>   
Yes, I understand. And what I'm telling you is a header rule checking
the "from" header, will match EITHER the contents of From: or Return-Path:

It won't just look at the From: header. SA considers both to be "From"
headers of a sort, so it runs the rules against both of them. This saves
a lot of duplication of rules that would need to be written to check all
the possible "from" type headers in a message. It's more-or-less the
same as why a body rule can match the Subject: header text.

As long as SA is being called after your MDA adds the Return-Path:
header, the rule should work.

If it's not working, try this one:

header MY_NULL_RETURN2    From =~/\<\>/
score MY_NULL_RETURN2   0.5



Re: How to whitelist_from <> ?

Posted by Philip Prindeville <ph...@redfish-solutions.com>.
Matt Kettler wrote:

>Philip Prindeville wrote:
>  
>
>>Matt Kettler wrote:
>>
>>  
>>    
>>
>>>Philip Prindeville wrote:
>>> 
>>>
>>>    
>>>      
>>>
>>>>There's no way to whitelist just the empty address then?  Rather than
>>>>everything?
>>>>
>>>>-Philip
>>>>
>>>> 
>>>>   
>>>>
>>>>      
>>>>        
>>>>
>>>Not given the simple file-glob format of the whitelist commands. You'd
>>>need a regular expression and negation.
>>>
>>>You could do it with a rule...
>>>
>>>header __NULL_RETURN   From !~   /./i
>>>header __RCVD_MYHOST   Received =~ /<insert Received header regex
>>>matching your servers exchanging..>/
>>>meta MY_NULL_RETURN   (__NULL_RETURN && __RCVD_MYHOST)
>>>
>>>
>>> 
>>>
>>>    
>>>      
>>>
>>It's not the From, but rather the EnvelopeFrom.
>>  
>>    
>>
>A rule matching "header From" should match any "from like" header,
>including Return-Path.
>  
>

Not sure I follow.

The From: header will be <ma...@foo.bar> or <po...@foo.bar>
or something similar (depending on the agent).

The Sender (EnvelopeFrom will be empty, however).  I believe that MdF
sticks that into the ReturnPath: header.

-Philip

>Unless you're calling SA before the return-path header is created, in
>which case you can't match it with SA at all.
>  
>
>>  
>>    
>>
>
>  
>


Re: How to whitelist_from <> ?

Posted by Matt Kettler <mk...@comcast.net>.
Philip Prindeville wrote:
> Matt Kettler wrote:
>
>   
>> Philip Prindeville wrote:
>>  
>>
>>     
>>> There's no way to whitelist just the empty address then?  Rather than
>>> everything?
>>>
>>> -Philip
>>>
>>>  
>>>    
>>>
>>>       
>> Not given the simple file-glob format of the whitelist commands. You'd
>> need a regular expression and negation.
>>
>> You could do it with a rule...
>>
>> header __NULL_RETURN   From !~   /./i
>> header __RCVD_MYHOST   Received =~ /<insert Received header regex
>> matching your servers exchanging..>/
>> meta MY_NULL_RETURN   (__NULL_RETURN && __RCVD_MYHOST)
>>
>>
>>  
>>
>>     
>
> It's not the From, but rather the EnvelopeFrom.
>   
A rule matching "header From" should match any "from like" header,
including Return-Path.

Unless you're calling SA before the return-path header is created, in
which case you can't match it with SA at all.
>
>
>