Skaag Argonius a écrit : > Anyone here knows what needs to be done to have spam go into a junk mail > folder of the user, instead of being rejected? > > The way I see it, mail that reached spamassassin has already been > received by the server, so for the chance that it might be ham, I'd like > it to be stored in a junk mail folder of the user, instead of being > discarded. > > My setup is vpopmail + qmail + qpsmtpd, Maildir format. > > How? :-)
No need to do that inside qpsmtpd. I personally use maildrop (http://www.courier-mta.org/maildrop/), which is a Maildir equivalent of procmail. My .qmail file looks like this: | /usr/bin/spamc | /usr/bin/maildrop Maildir/.mailfilter And here's the relevant part of Maildir/.mailfilter: ----- BOITE=$HOME/Maildir # BigSpam # X-Spam-Status: Yes, hits=-4.4 required=5.0 if ( /^X-Spam-Status: Yes/ ) { SCORE = `$HOME/Maildir/.spamThreshold.pl`; if ( $SCORE > 15 ) { to "$BOITE/.Trash/"; } else { to "$BOITE/.Spam/"; } } ----- and Maildir/.spamThreshold.pl ----- #!/usr/bin/perl -w use strict; my $gotit=0; while (<>) { # X-Spam-Status: Yes, score=2.8 required=5.0 # X-Spam-Status: Yes, hits=28.3 required=5.0 #if (/^X-Spam-Status: Yes, hits=([0-9]+\.[0-9]) required=5.0/) { if (/^X-Spam-Status: Yes, score=([0-9]+\.[0-9]) required=5.0/) { print $1 ."\n"; $gotit=1; last; } } print "0\n" unless $gotit; ----- Hope this helps, GFK's -- Guillaume Filion, ing. jr Logidac Tech., Beaumont, Québec, Canada - http://logidac.com/ PGP Key and more: http://guillaume.filion.org/
signature.asc
Description: OpenPGP digital signature
