7 Aug 2008 17:03
Re: SpamAssassin regexp question
Jan Pieter Cornet <johnpc <at> xs4all.nl>
2008-08-07 15:03:04 GMT
2008-08-07 15:03:04 GMT
Sorry for the slow reply... but I had to react (omg! somebody on the intarweb is r0ng!) On Wed, Jul 30, 2008 at 11:59:57AM -0400, Joseph Brennan wrote: >> # This mail was sent by... >> rawbody UAH_SENTBY1 /^This email was sent by:$/ >> score UAH_SENTBY1 1.0 >> rawbody UAH_SENTBY2 /^Unsubscribe: http:.+\/accounts$/ >> score UAH_SENTBY2 1.0 >> >> When I ran command line spamassassin against a copy of the message, the >> tests did not hit. When I changed it to this: >> >> # This mail was sent by... >> rawbody UAH_SENTBY1 /\nThis email was sent by:\n/ >> score UAH_SENTBY1 1.0 >> rawbody UAH_SENTBY2 /\nUnsubscribe: http:.+\/accounts\n/ >> score UAH_SENTBY2 1.0 >> >> they did. What's the difference? Thanks... > > The symbols ^ and $ do not always mean start and end of line. They > mean start and end of the chunk perl is working with, which can be > changed by redefining $/. SpamAssassin seems to read the whole > message in one chunk, so that it can match across lines. This is... an oversimplification. The ^ and $ symbols match at the beginning and end (respectively) of the string. When you are reading from a file handle, strings are(Continue reading)
RSS Feed