How to add X-Bogosity line in qmail
Todd Underwood
todd-bogofilter at osogrande.com
Fri Mar 7 13:40:11 CET 2003
paulo, all,
On Fri, 7 Mar 2003, Paulo Jan wrote:
> I'm using qmail and I want to set up bogofilter on a per-user basis,
> calling it from the .qmail (dot-qmail) file. What I don't know is how to
> make bogofilter add the "X-Bogosity" line in each mail that it
> processes; I've tried with the "-p" switch, but it doesn't seem to work.
> I'm calling bogofilter using this .qmail file:
>
> |condredirect [local address for spam] /usr/bin/bogofilter -p
> ./Maildir/
this doesn't do what you think it does. :-)
each line in a .qmail file is processed *independently*. that means that
whatever modification to the message made by running bogofilter in -p mode
in the first line are ignored by the second line. in other words,
"./Maildir/" is given its own, unmodified copy of the messge being
delivered.
there are three basic ways to do what you want:
1) deliver to a script. instead of just using condredirect, deliver to a
script that modifies the message, parses the header and then either
completes the delivery or re-injects the message based on the results.
2) use something like procmail that has these kinds of properties
(procmail has historically been a security disaster, so i would stay away
from it if possibly--consider maildrop).
3) do something creative with condredirect. basically, never deliver
anything out of your .qmail file directly. always deliver to an alias.
take advantage of the -e -p combination in bogofilter to do a second
delivery if the first doesn't match. basically:
| condredirect [local address for spam] /usr/bin/bogofilter -f -p
| condredirect [local address for nonspam] /usr/bin/bogofilter -f -e -p
./Maildir/
in this case the final ./Maildir/ should never be reached, and every
message is re-injected to a new address. this means two local deliveries
for every message (rather than two local deliveries per spam only), but
local delivery bandwidth is *almost* *never* the problem for qmail
installations.
warning: this is just typed in, not tested.
for more info 'man dot-qmail'
> I've searched in the qmail mailing list archives, but they don't have
> further suggestions, and I couldn't search this list's archives because
> I don't know where they are <g>.
me, neither. i could only find archives that weren't being updated.
folx: why don't you have archives set up for this list over on
sourceforge?
t.
--
todd underwood, sr. vp & cto
oso grande technologies, inc.
todd at osogrande.com
"The people never give up their liberties but under some delusion."
--Edmund Burke, Speech at County Meeting of Bucks, 1784.
More information about the Bogofilter
mailing list