Spamassassin rules based on IP

Matt Kettler mkettler at evi-inc.com
Tue Apr 22 16:21:30 IST 2008


There's no provision in spamassassin for conditionally swapping CF files in or 
out at scan time.

SpamAssassin parses all the .cf files once, and once only when an instance is 
created, and then that pre-parsed ruleset is re-used for all scanning tasks 
until the instance dies.

In order to implement this feature, the rules would have to be re-parsed on a 
per-message basis, and that's not practical for efficiency reasons.

If you have a limited set of rulebases you need, you could create separate 
SpamAssassin instances and call the different instances depending on which set 
you want to use, however this isn't really compatible with MailScanner's model 
of the universe. It's also a massive memory sink in any event.


Gottschalk, David wrote:
> Can anyone give me any insight into how to do this?
> 
> I can't determine how I would go about this.
> 
> Thanks!
> 
> David Gottschalk
> UTS Email Team
> david.gottschalk at emory.edu
> 
> -----Original Message-----
> From: mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Gottschalk, David
> Sent: Tuesday, April 15, 2008 8:07 AM
> To: MailScanner discussion
> Subject: RE: Spamassassin rules based on IP
> 
> I'm not sure I'm following you.
> 
> Are you saying create spamassassin rules that filter based on IP?
> 
> David Gottschalk
> UTS Email Team
> david.gottschalk at emory.edu
> 
> -----Original Message-----
> From: mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Hugo van der Kooij
> Sent: Tuesday, April 15, 2008 1:27 AM
> To: MailScanner discussion
> Subject: Re: Spamassassin rules based on IP
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Gottschalk, David wrote:
> | Hi All,
> |         Does anyone know if it is possible to have MailScanner use
> different spamassassin rules based on IP? For example, I'd like one IP
> subnet to use certain .cf files, and another use different .cf files.
> I'd searched, but can't seem to find a method to do this.
> 
> You got to do this the other way around. You have 1 config with rules
> files and for (almost) each decision you can use a rule file and decide
> differently based on Sender IP, Sender and/or Recipient.
> 
> Hugo.
> 
> - --
> hvdkooij at vanderkooij.org               http://hugo.vanderkooij.org/
> PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc
> 
>         A: Yes.
>         >Q: Are you sure?
>         >>A: Because it reverses the logical flow of conversation.
>         >>>Q: Why is top posting frowned upon?
> 
> Bored? Click on http://spamornot.org/ and rate those images.
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> 
> iD8DBQFIBDygBvzDRVjxmYERApnzAKC3p5uX2tGOASa4rLd8fjSYYSbwtgCff+rE
> hExMs3kuIlzulMxQBGF6W60=
> =qfiq
> -----END PGP SIGNATURE-----
> --
> MailScanner mailing list
> mailscanner at lists.mailscanner.info
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
> 
> Before posting, read http://wiki.mailscanner.info/posting
> 
> Support MailScanner development - buy the book off the website!
> 
> This e-mail message (including any attachments) is for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> information.  If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination, distribution
> or copying of this message (including any attachments) is strictly
> prohibited.
> 
> If you have received this message in error, please contact
> the sender by reply e-mail message and destroy all copies of the
> original message (including attachments).
> --
> MailScanner mailing list
> mailscanner at lists.mailscanner.info
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
> 
> Before posting, read http://wiki.mailscanner.info/posting
> 
> Support MailScanner development - buy the book off the website!
> 
> This e-mail message (including any attachments) is for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> information.  If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination, distribution
> or copying of this message (including any attachments) is strictly
> prohibited.
> 
> If you have received this message in error, please contact
> the sender by reply e-mail message and destroy all copies of the
> original message (including attachments).



More information about the MailScanner mailing list