You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Dan Barker <db...@visioncomm.net> on 2007/02/08 16:44:02 UTC

Blackberry email

Blackberry emails trigger a bunch of BASE64 rules, that are not meaningful.
It's just the way it works.

Two thoughts:

a) If blackberry.com doesn't often spam, why not:

whitelist_from_rcvd * blackberry.com

Doing this appears to work, but there is a note in
perldoc::mail::spamassassin::conf that says:

whitelist_allows_relays add@ress.com
    Specify addresses which are in "whitelist_from_rcvd" that sometimes
    send through a mail relay other than the listed ones. By default
    mail with a From address that is in "whitelist_from_rcvd" that does
    not match the relay will trigger a forgery rule. Including the
    address in "whitelist_allows_relay" prevents that.

This does not appear to be happening (IE, I don't see non-blackberry mail
triggering a "forgery rule"). Is the note wrong? Does it only apply if there
is more meat to the address than just a "*"?



b) Maybe I'd be better off with a few points (vs -100 from a whitelist) if
the received_from ends blackberry. I could write a rule for that, and score
say -4.



Which way should I go? If a) need I worry about whitelist_allows_relays?

Dan Barker



REF:

 pts rule name              description
---- ---------------------- ------------------------------------------------
--
 1.9 MIME_BASE64_TEXT       RAW: Message text disguised using base64
encoding
 0.2 MIME_BASE64_NO_NAME    RAW: base64 attachment does not have a file name
 1.3 FROM_EXCESS_BASE64     From: base64 encoded unnecessarily
 1.7 LW_STOCK_SPAM4         Yup, its a spam!


Re: Blackberry email

Posted by Loren Wilton <lw...@earthlink.net>.
> Thanks John, that was exactly the feedback I was requesting. Yes, that is 
> my
> MTA's header and I'll add the qualification you suggest. I was assuming
> (oops, shouldn't do that) that "Received =~" meant the first, non-local
> Recieved line. Evidently (from your comment about forgeries), SA uses ALL
> received headers for these checks.

Yes it does if you do Received.  If you have trusted_networks set up right 
there is a pseudo-header that you can use that will be just the record you 
want, I believe.  Of course I can't remember the name of that header, but 
I'm sure someone else does.

        Loren


RE: Blackberry email

Posted by Dan Barker <db...@visioncomm.net>.
Thanks John, that was exactly the feedback I was requesting. Yes, that is my
MTA's header and I'll add the qualification you suggest. I was assuming
(oops, shouldn't do that) that "Received =~" meant the first, non-local
Recieved line. Evidently (from your comment about forgeries), SA uses ALL
received headers for these checks.

Dan

-----Original Message-----
From: John D. Hardin [mailto:jhardin@impsec.org]
Sent: Thursday, February 08, 2007 3:52 PM
To: Dan Barker
Cc: users@spamassassin.apache.org
Subject: RE: Blackberry email


On Thu, 8 Feb 2007, Dan Barker wrote:

> How's this? Too loose?
>
> header   CRACKBERRY Received =~ /blackberry.com\b/i

/\.blackberry\.com\b/i

It'll trust forgeries, though.

> Example header:
>
> Received: from smtp01.bis.na.blackberry.com [216.9.248.48] by
> mail.visioncomm.net with ESMTP (SMTPD32-13.5) id AC3534020148; Thu, 08 Feb
> 2007 10:05:25 -0500

Better would be to only consider the one *your* MTA adds:

/\sfrom \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i

(assuming the header above is indeed the one your MTA added...)

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays



Re: Blackberry email

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
John D. Hardin wrote:
> On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:
> 
>> You could, of course, check the helo instead.
> 
> Isn't the HELO easily forged?

Yeah (that's why I suggested a rule using rdns), but that has nothing to 
do with the documentation about the pseudo headers in question (which is 
what your queries have been about).

Daryl

Re: Blackberry email

Posted by "John D. Hardin" <jh...@impsec.org>.
On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:

> You could, of course, check the helo instead.

Isn't the HELO easily forged?

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays


Re: Blackberry email

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
John D. Hardin wrote:
> On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:
>> John D. Hardin wrote:
>>> On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:
>>>
>>>> FWIW, if you were to write the rules using the
>>>> X-Spam-Relays-External pseudo header (or X-Spam-Relays-Untrusted
>>>> for older versions of SA) you could write generic rules that work
>>>> for everyone (or survive changes to your mail topology).
>>> ...can you give a ferinstance? I can't see how that would work from 
>>> the documentation of those pseudoheaders that in the wiki...
>>>
>>>   http://wiki.apache.org/spamassassin/TrustedRelays
>> Something like this will do:
>>
>> header BLAH X-Spam-Relays-External =~ /^[^\]]+ 
>> rdns=[a-z0-9_-]{1,30}\.blackberry\.com /i
> 
> Ah. Check the rdns instead of the HELO. Ok. The example on the wiki 
> doesn't have rdns info so that wasn't apparent.

You could, of course, check the helo instead.


> I think you also need a period in that as well:
> 
>   rdns=[.a-z0-9_-]{1,30}\.blackberry\.com

Yup.


Daryl

Re: Blackberry email

Posted by "John D. Hardin" <jh...@impsec.org>.
On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:
> John D. Hardin wrote:
> > On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:
> > 
> >> FWIW, if you were to write the rules using the
> >> X-Spam-Relays-External pseudo header (or X-Spam-Relays-Untrusted
> >> for older versions of SA) you could write generic rules that work
> >> for everyone (or survive changes to your mail topology).
> > 
> > ...can you give a ferinstance? I can't see how that would work from 
> > the documentation of those pseudoheaders that in the wiki...
> > 
> >   http://wiki.apache.org/spamassassin/TrustedRelays
> 
> Something like this will do:
> 
> header BLAH X-Spam-Relays-External =~ /^[^\]]+ 
> rdns=[a-z0-9_-]{1,30}\.blackberry\.com /i

Ah. Check the rdns instead of the HELO. Ok. The example on the wiki 
doesn't have rdns info so that wasn't apparent.

I think you also need a period in that as well:

  rdns=[.a-z0-9_-]{1,30}\.blackberry\.com

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays


Re: Blackberry email

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
John D. Hardin wrote:
> On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:
> 
>> FWIW, if you were to write the rules using the
>> X-Spam-Relays-External pseudo header (or X-Spam-Relays-Untrusted
>> for older versions of SA) you could write generic rules that work
>> for everyone (or survive changes to your mail topology).
> 
> ...can you give a ferinstance? I can't see how that would work from 
> the documentation of those pseudoheaders that in the wiki...
> 
>   http://wiki.apache.org/spamassassin/TrustedRelays
> 
>> Dan Barker wrote:
>>
>>> /^from \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i


Something like this will do:

header BLAH X-Spam-Relays-External =~ /^[^\]]+ 
rdns=[a-z0-9_-]{1,30}\.blackberry\.com /i


Daryl

Re: Blackberry email

Posted by "John D. Hardin" <jh...@impsec.org>.
On Thu, 8 Feb 2007, Daryl C. W. O'Shea wrote:

> FWIW, if you were to write the rules using the
> X-Spam-Relays-External pseudo header (or X-Spam-Relays-Untrusted
> for older versions of SA) you could write generic rules that work
> for everyone (or survive changes to your mail topology).

...can you give a ferinstance? I can't see how that would work from 
the documentation of those pseudoheaders that in the wiki...

  http://wiki.apache.org/spamassassin/TrustedRelays

> Dan Barker wrote:
> 
> > /^from \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays


Re: Blackberry email

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
FWIW, if you were to write the rules using the X-Spam-Relays-External 
pseudo header (or X-Spam-Relays-Untrusted for older versions of SA) you 
could write generic rules that work for everyone (or survive changes to 
your mail topology).


Daryl


Dan Barker wrote:
> John, it almost worked<g>.
> 
> The "from blah.blah.blah.blackberry.com is at the beginning of the header.
> So \s needed to be ^ instead. Anyhow, Thanks again.
> 
> Dan
> 
> /^from \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i
> 
> -----Original Message-----
> From: John D. Hardin [mailto:jhardin@impsec.org]
> Sent: Thursday, February 08, 2007 3:52 PM
> To: Dan Barker
> Cc: users@spamassassin.apache.org
> Subject: RE: Blackberry email
> 
> 
> On Thu, 8 Feb 2007, Dan Barker wrote:
> 
>> How's this? Too loose?
>>
>> header   CRACKBERRY Received =~ /blackberry.com\b/i
> 
> /\.blackberry\.com\b/i
> 
> It'll trust forgeries, though.
> 
>> Example header:
>>
>> Received: from smtp01.bis.na.blackberry.com [216.9.248.48] by
> mail.visioncomm.net with ESMTP (SMTPD32-13.5) id AC3534020148; Thu, 08 Feb
>> 2007 10:05:25 -0500
> 
> Better would be to only consider the one *your* MTA adds:
> 
> /\sfrom \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i
> 
> (assuming the header above is indeed the one your MTA added...)
> 
> --
>  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
> -----------------------------------------------------------------------
>   Gun control is marketed to the public with the idea that violent
>   criminals will obey the law. This is an appealing delusion.
> -----------------------------------------------------------------------
>  4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays
> 
> 


RE: Blackberry email

Posted by "John D. Hardin" <jh...@impsec.org>.
On Thu, 8 Feb 2007, Dan Barker wrote:

> John, it almost worked<g>.
> 
> The "from blah.blah.blah.blackberry.com is at the beginning of the header.
> So \s needed to be ^ instead. Anyhow, Thanks again.

d'oh!

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays


RE: Blackberry email

Posted by Dan Barker <db...@visioncomm.net>.
John, it almost worked<g>.

The "from blah.blah.blah.blackberry.com is at the beginning of the header.
So \s needed to be ^ instead. Anyhow, Thanks again.

Dan

/^from \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i

-----Original Message-----
From: John D. Hardin [mailto:jhardin@impsec.org]
Sent: Thursday, February 08, 2007 3:52 PM
To: Dan Barker
Cc: users@spamassassin.apache.org
Subject: RE: Blackberry email


On Thu, 8 Feb 2007, Dan Barker wrote:

> How's this? Too loose?
>
> header   CRACKBERRY Received =~ /blackberry.com\b/i

/\.blackberry\.com\b/i

It'll trust forgeries, though.

> Example header:
>
> Received: from smtp01.bis.na.blackberry.com [216.9.248.48] by
mail.visioncomm.net with ESMTP (SMTPD32-13.5) id AC3534020148; Thu, 08 Feb
> 2007 10:05:25 -0500

Better would be to only consider the one *your* MTA adds:

/\sfrom \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i

(assuming the header above is indeed the one your MTA added...)

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays



RE: Blackberry email

Posted by "John D. Hardin" <jh...@impsec.org>.
On Thu, 8 Feb 2007, Dan Barker wrote:

> How's this? Too loose?
> 
> header   CRACKBERRY Received =~ /blackberry.com\b/i

/\.blackberry\.com\b/i

It'll trust forgeries, though.

> Example header:
> 
> Received: from smtp01.bis.na.blackberry.com [216.9.248.48] by
> mail.visioncomm.net with ESMTP (SMTPD32-13.5) id AC3534020148; Thu, 08 Feb
> 2007 10:05:25 -0500

Better would be to only consider the one *your* MTA adds:

/\sfrom \S{1,30}\.blackberry\.com\s\S+\sby mail\.visioncomm\.net\s/i

(assuming the header above is indeed the one your MTA added...)

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays


RE: Blackberry email

Posted by Dan Barker <db...@visioncomm.net>.
Thanks for the votes for answer b)!

>>b) Maybe I'd be better off with a few points (vs -100 from a whitelist) if
>>the received_from ends blackberry. I could write a rule for that, and
score
>>say -4.
>
>Write a rule to score the message by -2 if it is received from
*.blackberry.com
>
>Regards,
>-sm

How's this? Too loose?

header   CRACKBERRY Received =~ /blackberry.com\b/i
score    CRACKBERRY -2
describe CRACKBERRY Blackberry loses a lot on BASE64 rules, even it out.

Example header:

Received: from smtp01.bis.na.blackberry.com [216.9.248.48] by
mail.visioncomm.net with ESMTP (SMTPD32-13.5) id AC3534020148; Thu, 08 Feb
2007 10:05:25 -0500


Re: Blackberry email

Posted by SM <sm...@resistor.net>.
At 07:44 08-02-2007, Dan Barker wrote:
>Blackberry emails trigger a bunch of BASE64 rules, that are not meaningful.
>It's just the way it works.
>
>b) Maybe I'd be better off with a few points (vs -100 from a whitelist) if
>the received_from ends blackberry. I could write a rule for that, and score
>say -4.

Write a rule to score the message by -2 if it is received from *.blackberry.com

Regards,
-sm 


Re: Blackberry email

Posted by "John D. Hardin" <jh...@impsec.org>.
On Thu, 8 Feb 2007, Dan Barker wrote:

> b) Maybe I'd be better off with a few points (vs -100 from a
> whitelist) if the received_from ends blackberry. I could write a
> rule for that, and score say -4.

Maybe the core SA should add a beigelist_from_rcvd that scores -2 or 
so, for those MTAs you don't want to trust 100%...

:)

There's def_whitelist_from_rcvd but it scores -15.

--
 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
-----------------------------------------------------------------------
  Gun control is marketed to the public with the idea that violent
  criminals will obey the law. This is an appealing delusion.
-----------------------------------------------------------------------
 4 days until Abraham Lincoln's and Charles Darwin's 198th Birthdays