With so many people asking how to use spamassassin for Individual users when
you're using qmail and vpopmail, i decided to implement it, and here are the
results:

# add a user to the domain
> ~vpopmail/bin/vadduser [EMAIL PROTECTED] passwd


then you have to decide if you want to deliver all mail (with subject and
headers possibly modified), or if you want to throw away probable SPAM.

edit the user's .qmail-file

# if you want to deliver all messages (with subject/headers possibly
modified)
> echo '| /usr/local/bin/spamc | /home/to/vpopmail/bin/vdelivermail '\'\''
/home/to/vpopmail/domains/domain.com/spamtest' >
~vpopmail/domains/domain.com/.qmail-spamtest

# if you want to forward all messages to an external email address (with
subject/headers possibly modified)
> echo '| /usr/local/bin/spamc | /var/qmail/bin/forward [EMAIL PROTECTED]' >
~vpopmail/domains/domain.com/.qmail-spamtest

if you're delivering/forwarding all messages, you can then set up a Rule in
your Mail Client to filter based on Subject, or on the message header
containing "X-Spam-Status: Yes"

# if you want to throw away probable spam, and only deliver probable good
e-mail
> echo '| /usr/local/bin/spamc | /usr/local/script/emailchk.pl
/home/to/vpopmail/domains/domain.com/spamtest' >
~vpopmail/domains/domain.com/.qmail-spamtest

go to http://www.jeremykister.com/jeremy/perl/emailchk.pl and put the
contents in /usr/local/script/emailchk.pl
then,
> chmod a+x /usr/local/script/emailchk.pl

Note this requires PERL (was tested with 5.6), vpopmail (was tested with
version 5.2.1), Sys::Hostname, and SpamAssassin with spamd/spamc.

Tests show (using an UltraSPARC-II 270Mhz 640MB RAM, Solaris 2.7):
to throw away or deliver a short message is 7 seconds
to throw away or deliver long message is 9 seconds
to accept a short message is 2 seconds
to accept a long message is 2 seconds
I havent investigated the scalability when handling more than 1 message at a
time.

I'm not looking to support this code or implementation; it's to be used as
it is or for reference only, although if you see a problem with my code or
logic, please let me know.

-------------------------------------------------------------------
Jeremy Kister
www.jeremykister.com
PGP: http://www.jeremykister.com/jeremy/public_key.asc
-------------------------------------------------------------------




-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to