You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Noiano <no...@x-privat.org> on 2007/11/16 18:37:07 UTC

How to avoid spam analysis when unnecessary

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello folks
I have a little problem. My email provider has a spam filter which
marks all spam email with "[Suspected Spam]" in the subject of the
spam message. Now I would like that SpamAssassin when finds that
pattern in the subject immediately breaks any analysis and mark the
email as spam without performing any time consuming calculations. It
seems to me a waste of time to re-analyze spam email already
categorized as spam. So I joined the #SpamAssassin channel on
freenode and someone told me to add:

blacklist_subject [Suspected Spam]

but the analysis is still performed. So he told me to look at the
shortcircuit plugin. I looked at this page
http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Plugin_Shortcircuit.html
but I didn't understand what to write in my local.cf in order to
achieve my aims.

Can anyone help?

Thanks for you time

Noiano

PS:  SpamAssassin v3.2.1 on perl 5.8.8, OS:ubuntu linux 7.04
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iE8DBQFHPdVD+JjGoasQ6NIRCHFCAN40tdDdtmatHjZrjKDUm0x03pU8PHKF1mWA
v/bgAN9cjRrZJq62/sMbLUsVgvfkQkPhUmoDaBxqEpSH
=CZMN
-----END PGP SIGNATURE-----


Re: posting thru gmane to this list and not getting bombarded

Posted by Micah Anderson <mi...@riseup.net>.
* Justin Mason <jm...@jmason.org> [071119 14:13]:
> 
> Micah Anderson writes:
> > * jidanni@jidanni.org <ji...@jidanni.org> [071119 10:01]:
> > > N> PS: I post to this list using gmane. Is it possible to stop delivery
> > > N> on my email address so that I can post but I do not receive the list
> > > N> messages?
> > > 
> > > http://www.google.com/search?q=users-allow@spamassassin.apache.org
> > 
> > Can this information be added to
> > http://wiki.apache.org/spamassassin/MailingLists ?
> 
> go for it!  it's a wiki ;)

I'd like to, but I haven't been able to get
'users-allow@spamassassin.apache.org' to work, so it seems wrong to add
that if its not functioning.

micah

Re: posting thru gmane to this list and not getting bombarded

Posted by mouss <mo...@netoyen.net>.
Micah Anderson wrote:
> * jidanni@jidanni.org <ji...@jidanni.org> [071119 10:01]:
>   
>> N> PS: I post to this list using gmane. Is it possible to stop delivery
>> N> on my email address so that I can post but I do not receive the list
>> N> messages?
>>
>> http://www.google.com/search?q=users-allow@spamassassin.apache.org
>>     
>
> Can this information be added to
> http://wiki.apache.org/spamassassin/MailingLists ?
>   

I fail to see the relationship between the OP question and this google
search URL.

The thread in the search url is about filtering mail once it is
received. OP would like not to receive the mail in the first place.


Re: posting thru gmane to this list and not getting bombarded

Posted by Micah Anderson <mi...@riseup.net>.
* jidanni@jidanni.org <ji...@jidanni.org> [071119 10:01]:
> N> PS: I post to this list using gmane. Is it possible to stop delivery
> N> on my email address so that I can post but I do not receive the list
> N> messages?
> 
> http://www.google.com/search?q=users-allow@spamassassin.apache.org

Can this information be added to
http://wiki.apache.org/spamassassin/MailingLists ?

Micah

Re: posting thru gmane to this list and not getting bombarded

Posted by ji...@jidanni.org.
N> PS: I post to this list using gmane. Is it possible to stop delivery
N> on my email address so that I can post but I do not receive the list
N> messages?

http://www.google.com/search?q=users-allow@spamassassin.apache.org

Re: How to avoid spam analysis when unnecessary

Posted by Noiano <no...@x-privat.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

mouss wrote:
> The best approach is to not pass such messages to SA. How to do this
> depends on how you call SA.
> 

I cannot do that as SA is called through evolution mail.

Thanks

Noiano

PS: I post to this list using gmane. Is it possible to stop delivery
on my email address so that I can post but I do not receive the list
messages?

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

iE8DBQFHPs+8+JjGoasQ6NIRCB2BANkBt7xN7na5Fyd9/EkgizOn204EqhIEolFs
oBKBAOCBLMHpTWaCGw6RB7EzwwGQYg6Mz0QLC/iR1cgD
=4yR0
-----END PGP SIGNATURE-----


Re: How to avoid spam analysis when unnecessary

Posted by mouss <mo...@netoyen.net>.
Noiano wrote:
> Hello folks
> I have a little problem. My email provider has a spam filter which
> marks all spam email with "[Suspected Spam]" in the subject of the
> spam message. Now I would like that SpamAssassin when finds that
> pattern in the subject immediately breaks any analysis and mark the
> email as spam without performing any time consuming calculations. It
> seems to me a waste of time to re-analyze spam email already
> categorized as spam. So I joined the #SpamAssassin channel on
> freenode and someone told me to add:
>

The best approach is to not pass such messages to SA. How to do this
depends on how you call SA.


> blacklist_subject [Suspected Spam]
>
> but the analysis is still performed. So he told me to look at the
> shortcircuit plugin. I looked at this page
> http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Plugin_Shortcircuit.html
> but I didn't understand what to write in my local.cf in order to
> achieve my aims.
>
> Can anyone help?


Re: How to avoid spam analysis when unnecessary

Posted by Matt Kettler <mk...@verizon.net>.
Noiano wrote:
>
>
> Spamd is loaded at startup. If evolution calls spamassassin there is
> no point loading spamd at startup right?
Correct. If evolution is calling SpamAssassin using the "spamassassin"
command line script, then spamd won't be used. Use of spamd is the
defining difference between the "spamassassin" and "spamc" command-line
tools.


Re: How to avoid spam analysis when unnecessary

Posted by Noiano <no...@x-privat.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Matt Kettler wrote:
> Noiano wrote:
>> McDonald, Dan wrote:
>>> Ah, I gave you the syntax backwards.  Should be:
>>> priority SUBJECT_IN_BLACKLIST -500
> 
> Odds are that change is irrelevant. In SA 3.2.3 at least, the
> SUBJECT_IN_BLACKLIST is already configured with priority -900 and
> shortcircuiting enabled, provided the Shortcircuit (not loaded by
> default) and WhiteListSubject (loaded by default) plugins are loaded.
> 
>> Now it works but it doesn't seem to speed up the analysis process.
>> It takes all most a second to analyze a message that meets the
>> subject rule. Is there anything else that needs to be done?
> Is your evolution calling "spamassassin" or is it calling "spamc"?

As long as I can see from top evolution calls spamassassin and not
spamc :-(. I also have seen something like "spamd child". What is that?

> 
> If it's calling "spamassassin", well, that's going to create a new
> spamassassin instance for every message, and is going to be slow and
> expensive to start up. Shortcircuiting can't bypass the overhead of
> calling SA, which is probably where most of your time is spent when
> using "spamassassin".

I can do nothing about that, what a pity

> You could switch to spamc, but this requires that you keep spamd running
> on your system. That means that there will always be at least one
> spamassassin instance loaded in memory (and thus occupying memory) at
> all times. This makes scanning messages *MUCH* faster, but if you're not
> running a lot of email, it wastes memory.

Spamd is loaded at startup. If evolution calls spamassassin there is
no point loading spamd at startup right?

> Also, if you are using spamd you *must* restart it every time you make
> config changes other than user_prefs.

I always restart when changing something in the settings files.

> 
> On my test box, spamd takes up 60mb of memory.
> 
> Without a blacklist_subject:
> --------------------------
> $  time spamassassin  <sample-spam.txt
> <snip>
> real    0m5.832s
> 
> $ time spamc <sample-spam.txt
> <snip>
> real    0m1.134s
> 
> Note the really big difference in time.
> 
> With a blacklist_subject and shortcircuiting enabled:
> --------------------------
> $  time spamassassin  <sample-spam.txt
> <snip>
> real    0m2.198s
> 
> $ time spamc <sample-spam.txt
> <snip>
> real    0m0.123s
> 
> Note that both got faster, but the plain spamassassin is still slower
> than spamc is even when spamc isn't shortcircuiting the message.

I see....

Thanks for your time!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iE8DBQFHQBAK+JjGoasQ6NIRCALqAN4otby3iYTNI2wRsEVxoySLOVWfa47tVWv8
yxKEAN9HvgP6qh2wJArs2bWT3IZZq3VcHh4t2NUju2kH
=+L0q
-----END PGP SIGNATURE-----


Re: How to avoid spam analysis when unnecessary

Posted by Matt Kettler <mk...@verizon.net>.
Noiano wrote:
> McDonald, Dan wrote:
> > Ah, I gave you the syntax backwards.  Should be:
> > priority SUBJECT_IN_BLACKLIST -500

Odds are that change is irrelevant. In SA 3.2.3 at least, the
SUBJECT_IN_BLACKLIST is already configured with priority -900 and
shortcircuiting enabled, provided the Shortcircuit (not loaded by
default) and WhiteListSubject (loaded by default) plugins are loaded.

>
> Now it works but it doesn't seem to speed up the analysis process.
> It takes all most a second to analyze a message that meets the
> subject rule. Is there anything else that needs to be done?
Is your evolution calling "spamassassin" or is it calling "spamc"?

If it's calling "spamassassin", well, that's going to create a new
spamassassin instance for every message, and is going to be slow and
expensive to start up. Shortcircuiting can't bypass the overhead of
calling SA, which is probably where most of your time is spent when
using "spamassassin".

You could switch to spamc, but this requires that you keep spamd running
on your system. That means that there will always be at least one
spamassassin instance loaded in memory (and thus occupying memory) at
all times. This makes scanning messages *MUCH* faster, but if you're not
running a lot of email, it wastes memory.

Also, if you are using spamd you *must* restart it every time you make
config changes other than user_prefs.


On my test box, spamd takes up 60mb of memory.

Without a blacklist_subject:
--------------------------
$  time spamassassin  <sample-spam.txt
<snip>
real    0m5.832s

$ time spamc <sample-spam.txt
<snip>
real    0m1.134s

Note the really big difference in time.

With a blacklist_subject and shortcircuiting enabled:
--------------------------
$  time spamassassin  <sample-spam.txt
<snip>
real    0m2.198s

$ time spamc <sample-spam.txt
<snip>
real    0m0.123s

Note that both got faster, but the plain spamassassin is still slower
than spamc is even when spamc isn't shortcircuiting the message.



Re: How to avoid spam analysis when unnecessary

Posted by Noiano <no...@x-privat.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

McDonald, Dan wrote:
> Ah, I gave you the syntax backwards.  Should be:
> priority SUBJECT_IN_BLACKLIST -500
> 
Now it works but it doesn't seem to speed up the analysis process.
It takes all most a second to analyze a message that meets the
subject rule. Is there anything else that needs to be done?

Thanks

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

iE8DBQFHPvRw+JjGoasQ6NIRCJPMAOCaX4KhDJg/wZjKkB83sngr2R7tRwkrmSTB
C25eAN4lLUirhdpn3I7kyqDS7qHS8PFKdlRB00i0jhFo
=awN/
-----END PGP SIGNATURE-----


Re: How to avoid spam analysis when unnecessary

Posted by "McDonald, Dan" <Da...@austinenergy.com>.
On Sat, 2007-11-17 at 12:23 +0100, Noiano wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> McDonald, Dan wrote:

> > in local.cf
> > 
> > ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
> > 
> > priority -500 SUBJECT_IN_BLACKLIST
> > shortcircuit SUBJECT_IN_BLACKLIST spam
> > 
> > endif
> > 
> I get this message when I restart spamassassin:
> 
> Restarting SpamAssassin Mail Filter Daemon: [6636] warn: Argument
> "SUBJECT_IN_BLACKLIST" isn't numeric in numeric comparison (<=>) at
> /usr/share/perl5/Mail/SpamAssassin/Conf/Parser.pm line 825.
> spamd.
> 

Ah, I gave you the syntax backwards.  Should be:
priority SUBJECT_IN_BLACKLIST -500

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


Re: How to avoid spam analysis when unnecessary

Posted by Noiano <no...@x-privat.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

McDonald, Dan wrote:
 > in whatever.pre:
> 
> loadplugin Mail::SpamAssassin::Plugin::Shortcircuit

Done, I have put that line into init.pre

> 
> 
> in local.cf
> 
> ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
> 
> priority -500 SUBJECT_IN_BLACKLIST
> shortcircuit SUBJECT_IN_BLACKLIST spam
> 
> endif
> 
I get this message when I restart spamassassin:

Restarting SpamAssassin Mail Filter Daemon: [6636] warn: Argument
"SUBJECT_IN_BLACKLIST" isn't numeric in numeric comparison (<=>) at
/usr/share/perl5/Mail/SpamAssassin/Conf/Parser.pm line 825.
spamd.

I also have blacklist_subject [Suspected Spam] in local.cf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iE8DBQFHPs9O+JjGoasQ6NIRCCCiAOCa6bs6qDyASBnLDNIlUwm3Q8EQPVSxxy/s
DjmKANoDEFWyZZXEIkyepwnMQLyXj6Q7Tg7vOODg6sBH
=mc6e
-----END PGP SIGNATURE-----


Re: How to avoid spam analysis when unnecessary

Posted by "McDonald, Dan" <Da...@austinenergy.com>.
On Fri, 2007-11-16 at 18:37 +0100, Noiano wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Hello folks
> I have a little problem. My email provider has a spam filter which
> marks all spam email with "[Suspected Spam]" in the subject of the
> spam message. Now I would like that SpamAssassin when finds that
> pattern in the subject immediately breaks any analysis and mark the
> email as spam without performing any time consuming calculations. It
> seems to me a waste of time to re-analyze spam email already
> categorized as spam. So I joined the #SpamAssassin channel on
> freenode and someone told me to add:
> 
> blacklist_subject [Suspected Spam]
> 
> but the analysis is still performed. So he told me to look at the
> shortcircuit plugin. I looked at this page
> http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Plugin_Shortcircuit.html
> but I didn't understand what to write in my local.cf in order to
> achieve my aims.
> 
> Can anyone help?

in whatever.pre:

loadplugin Mail::SpamAssassin::Plugin::Shortcircuit


in local.cf

ifplugin Mail::SpamAssassin::Plugin::Shortcircuit

priority -500 SUBJECT_IN_BLACKLIST
shortcircuit SUBJECT_IN_BLACKLIST spam

endif

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