Re: [vchkpw] Spam Assassin implementation
On Thursday 20 March 2003 18:35, Joe Young wrote: > > I have spamassassin running in the user's .qmail. It looks like this... > > | /var/qmail/bin/preline /usr/local/bin/maildrop > > /home/vpopmail/etc/mailfilter > > And the mailfilter script looking like this... > ## > #mailfilter > ## > import EXT > import HOST > import HOME > VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED] > VPOP="| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox" > > if ($SIZE < 262144) > { > xfilter "/usr/bin/spamc -u [EMAIL PROTECTED]" > } > > if ((/^X-Spam-Flag:.*YES/)) > { >`test -d $VHOME/Maildir/.JunkMail` >if( $RETURNCODE == 1 ) >{ >`maildirmake $VHOME/Maildir/.JunkMail;chown -R vpopmail.vchkpw > $VHOME/Maildir/.JunkMail` >} >to "$VHOME/Maildir/.JunkMail/" > } > > to "$VHOME/Maildir/" > > Just one question: what are your users doing with mail in $VHOME/Maildir/.JunkMail ? They have to access it in one way as you never can be sure whether it is really _only_ spam (well, this is why you save it and don't simply drop it). So.. are they all using imap ? Because this was worrying me. Setting up a spamfilter (i personally would stick with bogofilter..) is not my problem, but finding a way for my users to handle the spam marked mails. The X-Bogosity/X-Spam headers would be just great, but not all MUAs support filtering for userdefined headers (at least outlook express for windows doesn't). So i thought about offering two different solutions which my users could choose from: a) Simply add the X-Bogosity/X-Spam-Status Header for those who don't use MS oe. b) Move Spammail to a second popaccount [EMAIL PROTECTED] since outlookexpress can easily handle several pop accounts. As i thought of using mailaddresses for controlling the spamfilter anyway, this would just fit my plan. any mail to [EMAIL PROTECTED] calls bogofilter with "register mail as spam" (and eventually drops the mail to the [EMAIL PROTECTED] pop3 account) any mail to [EMAIL PROTECTED] calls bogofilter with "register mail as ham" (and eventually drops the mail at the [EMAIL PROTECTED] pop3 account) -- Mit internetten Grüßen/Best Regards --- Justin Heesemannionium Technologies [EMAIL PROTECTED]www.ionium.org
Re: [vchkpw] Spam Assassin implementation
Opps, the spamassassin stuff should be on one line | /var/qmail/bin/preline /usr/local/bin/maildrop /home/vpopmail/etc/mailfilter - Original Message - From: "Joe Young" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 20, 2003 8:50 AM Subject: [vchkpw] Spam Assassin implementation I have spamassassin running in the user's .qmail. It looks like this... | /var/qmail/bin/preline /usr/local/bin/maildrop /home/vpopmail/etc/mailfilter And the mailfilter script looking like this... ## #mailfilter ## import EXT import HOST import HOME VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED] VPOP="| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox" if ($SIZE < 262144) { xfilter "/usr/bin/spamc -u [EMAIL PROTECTED]" } if ((/^X-Spam-Flag:.*YES/)) { `test -d $VHOME/Maildir/.JunkMail` if( $RETURNCODE == 1 ) { `maildirmake $VHOME/Maildir/.JunkMail;chown -R vpopmail.vchkpw $VHOME/Maildir/.JunkMail` } to "$VHOME/Maildir/.JunkMail/" } to "$VHOME/Maildir/" - Original Message - From: "Cory Wright" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 19, 2003 8:22 AM Subject: Re: [vchkpw] Spam Assassin implementation On Wed, Mar 19, 2003 at 11:14:53AM -0500, John McGivern wrote: > Basically I have spam assassin installed and I have a .qmail-default in > every domain folder on my server. It looks like this: > > | /var/qmail/bin/preline -d /var/qmail/bin/bouncesaying "[message to bounce back if not SPAM]" > | /home/vpopmail/bin/vdelivermail ' ' bounce-no-mailbox Where exactly are you calling SpamAssassin? Cory -- Cory Wright Stand Blue Technology http://www.standblue.net/
RE: [vchkpw] Spam Assassin implementation
Thanks Benjamin! I didn't really know a qmail-scanner existed until I started posting. Thanks to everyone else too. I'LL BE BACK! -Original Message- From: Benjamin Tomhave [mailto:[EMAIL PROTECTED] Sent: March 19, 2003 6:39 PM To: John McGivern Cc: [EMAIL PROTECTED] Subject: RE: [vchkpw] Spam Assassin implementation I would suggest checking out http://qmail-scanner.sourceforge.net/ in order to learn about how qmail-scanner is setup and to help you figure out what's being called, etc. > -Original Message- > From: John McGivern [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 19, 2003 4:18 PM > To: Jonas Pasche; [EMAIL PROTECTED] > Subject: RE: [vchkpw] Spam Assassin implementation > > > Well, I think however the UNIX guy set this up before that it > does actually work - somehow (I'm obviously a little light on the > UNIX stuff compared to you guys!) I know that if these people > weren't getting mail I would be in big trouble so they are > receiving mail. And I know from looking in the queue that spam > messages are getting bounced back. > > I don't really know how to find out how the spam assassin is > being called. I don't really know anything about qmail-scanner > either. I guess I need to do some research on that. I would > just like to understand the whole process and know it is set up > properly because obviously it isn't set up properly :0 ;) > > Any ideas on where to start would be appreciated! > > Thanks, > > John McGivern > > -Original Message----- > From: Jonas Pasche [mailto:[EMAIL PROTECTED] > Sent: March 19, 2003 2:38 PM > To: [EMAIL PROTECTED] > Subject: Re: [vchkpw] Spam Assassin implementation > > > Hi John, > > > Somebody else had set this up a while ago - I think it is working but > > I'm not sure if it is affecting other mail deliveries. > > Oh well, it is... > > > Basically I have spam assassin installed and I have a .qmail-default > > in every domain folder on my server. It looks like this: > > > > | /var/qmail/bin/preline -d /var/qmail/bin/bouncesaying \ > > "[message to bounce back if not SPAM]" > > | /home/vpopmail/bin/vdelivermail ' ' bounce-no-mailbox > > The first line simply bounces _everything_ back to the sender, telling > him it is spam. You don't actually call any SpamAssassin program in your > .qmail-default file - how do you expect SpamAssassin to be actually used > in your setup? ;-) > > > Does this look like it should work okay with spam assassin? > > Definitely not. > > > I notice others .qmil-default files look a little different. > > Theirs might be hopefully working ;-) > > Personally, I'd prefer qmail-scanner to mark all messages with a spam > analysis header, and then use dot-qmail filtering to sort them out > later. Try out this, if your mail server supports qmail-scanner with > SpamAssassin integration. You'll need the 822mess package from DJB to > get the "822field" program. > > $ cat .qmail-default > | bouncesaying "I don't want your spam" 822field X-Spam-Flag > /dev/null > | /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox > > It's 822field in this case that checks for the presence of the > X-Spam-Flag header. If it's present, it bounces the message back to the > sender. If not, it continues with the next delivery instruction. > > Please be aware that qmailadmin occasionally rewrites .qmail-default, > causing your manual filtering rules to disappear! > > Jonas > > > >
RE: [vchkpw] Spam Assassin implementation
I would suggest checking out http://qmail-scanner.sourceforge.net/ in order to learn about how qmail-scanner is setup and to help you figure out what's being called, etc. > -Original Message- > From: John McGivern [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 19, 2003 4:18 PM > To: Jonas Pasche; [EMAIL PROTECTED] > Subject: RE: [vchkpw] Spam Assassin implementation > > > Well, I think however the UNIX guy set this up before that it > does actually work - somehow (I'm obviously a little light on the > UNIX stuff compared to you guys!) I know that if these people > weren't getting mail I would be in big trouble so they are > receiving mail. And I know from looking in the queue that spam > messages are getting bounced back. > > I don't really know how to find out how the spam assassin is > being called. I don't really know anything about qmail-scanner > either. I guess I need to do some research on that. I would > just like to understand the whole process and know it is set up > properly because obviously it isn't set up properly :0 ;) > > Any ideas on where to start would be appreciated! > > Thanks, > > John McGivern > > -Original Message- > From: Jonas Pasche [mailto:[EMAIL PROTECTED] > Sent: March 19, 2003 2:38 PM > To: [EMAIL PROTECTED] > Subject: Re: [vchkpw] Spam Assassin implementation > > > Hi John, > > > Somebody else had set this up a while ago - I think it is working but > > I'm not sure if it is affecting other mail deliveries. > > Oh well, it is... > > > Basically I have spam assassin installed and I have a .qmail-default > > in every domain folder on my server. It looks like this: > > > > | /var/qmail/bin/preline -d /var/qmail/bin/bouncesaying \ > > "[message to bounce back if not SPAM]" > > | /home/vpopmail/bin/vdelivermail ' ' bounce-no-mailbox > > The first line simply bounces _everything_ back to the sender, telling > him it is spam. You don't actually call any SpamAssassin program in your > .qmail-default file - how do you expect SpamAssassin to be actually used > in your setup? ;-) > > > Does this look like it should work okay with spam assassin? > > Definitely not. > > > I notice others .qmil-default files look a little different. > > Theirs might be hopefully working ;-) > > Personally, I'd prefer qmail-scanner to mark all messages with a spam > analysis header, and then use dot-qmail filtering to sort them out > later. Try out this, if your mail server supports qmail-scanner with > SpamAssassin integration. You'll need the 822mess package from DJB to > get the "822field" program. > > $ cat .qmail-default > | bouncesaying "I don't want your spam" 822field X-Spam-Flag > /dev/null > | /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox > > It's 822field in this case that checks for the presence of the > X-Spam-Flag header. If it's present, it bounces the message back to the > sender. If not, it continues with the next delivery instruction. > > Please be aware that qmailadmin occasionally rewrites .qmail-default, > causing your manual filtering rules to disappear! > > Jonas > > > >
RE: [vchkpw] Spam Assassin implementation
Well, I think however the UNIX guy set this up before that it does actually work - somehow (I'm obviously a little light on the UNIX stuff compared to you guys!) I know that if these people weren't getting mail I would be in big trouble so they are receiving mail. And I know from looking in the queue that spam messages are getting bounced back. I don't really know how to find out how the spam assassin is being called. I don't really know anything about qmail-scanner either. I guess I need to do some research on that. I would just like to understand the whole process and know it is set up properly because obviously it isn't set up properly :0 ;) Any ideas on where to start would be appreciated! Thanks, John McGivern -Original Message- From: Jonas Pasche [mailto:[EMAIL PROTECTED] Sent: March 19, 2003 2:38 PM To: [EMAIL PROTECTED] Subject: Re: [vchkpw] Spam Assassin implementation Hi John, > Somebody else had set this up a while ago - I think it is working but > I'm not sure if it is affecting other mail deliveries. Oh well, it is... > Basically I have spam assassin installed and I have a .qmail-default > in every domain folder on my server. It looks like this: > > | /var/qmail/bin/preline -d /var/qmail/bin/bouncesaying \ > "[message to bounce back if not SPAM]" > | /home/vpopmail/bin/vdelivermail ' ' bounce-no-mailbox The first line simply bounces _everything_ back to the sender, telling him it is spam. You don't actually call any SpamAssassin program in your .qmail-default file - how do you expect SpamAssassin to be actually used in your setup? ;-) > Does this look like it should work okay with spam assassin? Definitely not. > I notice others .qmil-default files look a little different. Theirs might be hopefully working ;-) Personally, I'd prefer qmail-scanner to mark all messages with a spam analysis header, and then use dot-qmail filtering to sort them out later. Try out this, if your mail server supports qmail-scanner with SpamAssassin integration. You'll need the 822mess package from DJB to get the "822field" program. $ cat .qmail-default | bouncesaying "I don't want your spam" 822field X-Spam-Flag > /dev/null | /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox It's 822field in this case that checks for the presence of the X-Spam-Flag header. If it's present, it bounces the message back to the sender. If not, it continues with the next delivery instruction. Please be aware that qmailadmin occasionally rewrites .qmail-default, causing your manual filtering rules to disappear! Jonas
Re: [vchkpw] Spam Assassin implementation
Hi John, > Somebody else had set this up a while ago - I think it is working but > I'm not sure if it is affecting other mail deliveries. Oh well, it is... > Basically I have spam assassin installed and I have a .qmail-default > in every domain folder on my server. It looks like this: > > | /var/qmail/bin/preline -d /var/qmail/bin/bouncesaying \ > "[message to bounce back if not SPAM]" > | /home/vpopmail/bin/vdelivermail ' ' bounce-no-mailbox The first line simply bounces _everything_ back to the sender, telling him it is spam. You don't actually call any SpamAssassin program in your .qmail-default file - how do you expect SpamAssassin to be actually used in your setup? ;-) > Does this look like it should work okay with spam assassin? Definitely not. > I notice others .qmil-default files look a little different. Theirs might be hopefully working ;-) Personally, I'd prefer qmail-scanner to mark all messages with a spam analysis header, and then use dot-qmail filtering to sort them out later. Try out this, if your mail server supports qmail-scanner with SpamAssassin integration. You'll need the 822mess package from DJB to get the "822field" program. $ cat .qmail-default | bouncesaying "I don't want your spam" 822field X-Spam-Flag > /dev/null | /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox It's 822field in this case that checks for the presence of the X-Spam-Flag header. If it's present, it bounces the message back to the sender. If not, it continues with the next delivery instruction. Please be aware that qmailadmin occasionally rewrites .qmail-default, causing your manual filtering rules to disappear! Jonas
Re: [vchkpw] Spam Assassin implementation
Jeremy Gault wrote: To me, the best method is using qmail-scanner, but that has the side effect that you can't toggle on/off spam and virus filtering on a per-user or per-domain basis. As long as you can live with that (I can) then I'd go with qmail-scanner. :) Jeremy, That's not entirely true, about not being able to toggle on/off spam filtering... you can configure spamassassin to whitelist mail to specific users and domains, but each time you change it MAY require a restart of spamd (it probably reads local.cf only on startup). see: http://www.spamassassin.org/doc/Mail_SpamAssassin_Conf.html In particular, the "whitelist_to" and associated configuration options. They accept wildcards, so if you wanted to not spam filter any mail to the domain winworld.cc, you could just add "whitelist_to [EMAIL PROTECTED]" I haven't actually tried this, so we're going on theory entirely here. Admittedly, this "solution" is ENTIRELY off topic for vchkpw =) - Rick
Re: [vchkpw] Spam Assassin implementation
John, I've never used that method myself. However, if it works then in theory you can turn on/off SA on a per-domain basis. Here's how we are doing it: We use qmail-scanner along with the QMAILQUEUE patch. Basically, qmail-scanner is configured to use clamav and SA for scanning. Since qmail-scanner is called in place of qmail-queue (done by setting the QMAILQUEUE environment variable in tcpserver) it scans all incoming mail for viruses and spam. Plus, we can use smtproutes to provide virus and spam filtering. (Just MX their domain to us, use smtproutes to route to their real mail esrver, and on the way through it gets scanned.) To me, the best method is using qmail-scanner, but that has the side effect that you can't toggle on/off spam and virus filtering on a per-user or per-domain basis. As long as you can live with that (I can) then I'd go with qmail-scanner. :) Jeremy Unless the network is lying to me again, John McGivern said: > Hi, > > I wanted to confirm what was the best way to implement spam assassin with a > qmail/vpopmail/qmailadmin setup. > > Somebody else had set this up a while ago - I think it is working but I'm not sure > if it is affecting other mail deliveries. > > Basically I have spam assassin installed and I have a .qmail-default in every domain > folder on my server. It looks like this: > > | /var/qmail/bin/preline -d /var/qmail/bin/bouncesaying "[message to bounce back if > not SPAM]" > | /home/vpopmail/bin/vdelivermail ' ' bounce-no-mailbox > > Does this look like it should work okay with spam assassin? I notice others > .qmil-default files look a little different. This was set up to handle all spam on > a domain basis. > > Thanks, > > John McGivern > -- Jeremy Gault <[EMAIL PROTECTED]> Network Administrator / MIS, WinWorld Corporation (v) 4237-473-8084 // (f) 423-472-9465
Re: [vchkpw] Spam Assassin implementation
On Wed, Mar 19, 2003 at 11:14:53AM -0500, John McGivern wrote: > Basically I have spam assassin installed and I have a .qmail-default in > every domain folder on my server. It looks like this: > > | /var/qmail/bin/preline -d /var/qmail/bin/bouncesaying "[message to bounce back if > not SPAM]" > | /home/vpopmail/bin/vdelivermail ' ' bounce-no-mailbox Where exactly are you calling SpamAssassin? Cory -- Cory Wright Stand Blue Technology http://www.standblue.net/