RE: adding score for email from noreply@

This is a discussion on RE: adding score for email from noreply@ within the SpamAssassin forums, part of the Tools category; Curtis LaMasters wrote: > I'm having a pretty hard time with this one for some reason, mainly > because I don't understand regex. I have a large number of emails ...

Go Back   Unix Linux Forum > Technologies & Tools > Tools > SpamAssassin

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 04:26 PM
Default RE: adding score for email from noreply@

Curtis LaMasters wrote:
> I'm having a pretty hard time with this one for some reason, mainly
> because I don't understand regex. I have a large number of emails
> that are getting past my spamassassin setup (Maia Mailguard 1.02a) as
> well as my Barracuda. I would like to add a score to email from
> noreply@*. I'm not asking for anyone to write the rule for me
> (though that would be nice), but general guidance on how to go about
> doing this *easily*.


Try this:

header FROM_NOREPLY ToCc =~ /\bnoreply\@/i

\b - word break...this must be the start of the string or whitespace
\@ - @ is special to Perl regex, so you have to escape it
Since you don't care what the domain is, there is no need to continue the
regex past the @.

I haven't tested this rule, so watch to make sure it does what it's supposed
to.

--
Bowie

Reply With Quote
  #2  
Old 08-26-2008, 04:31 PM
Default Re: adding score for email from noreply@

Excellent, Much easier than I was expecting. Thank you very much. I'll get
to testing.

Curtis LaMasters
http://www.curtis-lamasters.com
http://www.builtnetworks.com

Reply With Quote
  #3  
Old 08-26-2008, 05:00 PM
Default Re: adding score for email from noreply@

What is the i for after reply/ ? Would just general research for perl
expressions be helpful for me? I guessing so since Spamassassin uses perl
as it's language of choice.

Thanks for your input.

Curtis LaMasters
http://www.curtis-lamasters.com
http://www.builtnetworks.com

Reply With Quote
  #4  
Old 08-26-2008, 05:18 PM
Default Re: adding score for email from noreply@

On Tue, 26 Aug 2008, Curtis LaMasters wrote:

> What is the i for after reply/ ?


Case-insensitive match.

> Would just general research for perl expressions be helpful for me? I
> guessing so since Spamassassin uses perl as it's language of choice.


Learning how regular expressions work is a very good idea - they are
_very_ widely used in information processing.

http://oreilly.com/catalog/9780596528126/

--
John Hardin KA7OHZ http://www.impsec.org/~jhardin/
jhardin@impsec.org FALaholic #11174 pgpk -a jhardin@impsec.org
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
The question of whether people should be allowed to harm themselves
is simple. They *must*. -- Charles Murray
-----------------------------------------------------------------------
2 days until Exercise Your Rights day

Reply With Quote
  #5  
Old 08-26-2008, 05:29 PM
Default Re: adding score for email from noreply@

On Tue, 2008-08-26 at 16:00 -0500, Curtis LaMasters wrote:
> What is the i for after reply/ ?


case Insensitive

> Would just general research for perl expressions be helpful for me?

Yes. perldoc perlretut is a great place to start.

--
Daniel J McDonald, CCIE #2495, CISSP #78281, CNX
Austin Energy
http://www.austinenergy.com


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAki0dUsACgkQGvhCU13z7IhP5ACfQecfr85leJ 66TbmJYgaGjvgt
MhEAmQEXSMBtesKr0011fJfsLmIBihaA
=tiQI
-----END PGP SIGNATURE-----

Reply With Quote
  #6  
Old 08-26-2008, 05:30 PM
Default Re: adding score for email from noreply@

Bowie Bailey wrote:
> Curtis LaMasters wrote:
>> I'm having a pretty hard time with this one for some reason, mainly
>> because I don't understand regex. I have a large number of emails
>> that are getting past my spamassassin setup (Maia Mailguard 1.02a) as
>> well as my Barracuda. I would like to add a score to email from
>> noreply@*. I'm not asking for anyone to write the rule for me
>> (though that would be nice), but general guidance on how to go about
>> doing this *easily*.

>
> Try this:
>
> header FROM_NOREPLY ToCc =~ /\bnoreply\@/i
>


I guess he wants From or Reply-To, not ToCc.

> \b - word break...this must be the start of the string or whitespace
> \@ - @ is special to Perl regex, so you have to escape it
> Since you don't care what the domain is, there is no need to continue the
> regex past the @.
>
> I haven't tested this rule, so watch to make sure it does what it's supposed
> to.
>


Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 11:38 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger