Using exim's filters to call bogofilter seems to be outside the realms of it's capabilities. The exim mailing list hints at it's possibilities:
http://www.exim.org/mail-archives/exim-u sers/Week-of-Mon-20021118/msg00272.html
And the thread that it references:
http://www.exim.org/mail-archives/exim-u sers/Week-of-Mon-20021118/msg00063.html
To quote it:
http://www.exim.org/mail-archives/exim-u
And the thread that it references:
http://www.exim.org/mail-archives/exim-u
To quote it:
I recently set it up in my .forward (also wanted to stay within
exim). It requires a small setuid (or setgid) program bogofilt to
access the exim spool directory -- see the previous thread on
'$message_filename ?'.
if "${run{/bogofilt $message_id}{s}}" is s
then unseen pipe "bogofilter -s"
deliver spam
else unseen pipe "bogofilter -h"
endif
bogofilt simply runs a shell script bogofilt.sh, which includes:
cd /var/spool/exim/input &&
{ sed '1,/^$/d; s/^[0-9][^ ]* *//' "$1-H"
sed '1s/.*//; s/^From />&/' "$1-D"
} | bogofilter
The sed scripts rebuild the message and protect "^From " lines;
simply cat-ing the files might be sufficient.
Leave a comment
