[Dovecot] Dovecot and Bogofilter

Matthias-Christian Ott ott at mirix.org
Mon Nov 10 21:35:53 EET 2008


Patrick Nagel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Matthias
> 
> Matthias Andree wrote:
> > On Mon, 10 Nov 2008, Patrick Nagel wrote:
> >> The problem with modifying the mail after reclassification persists, hope this
> >> can be solved. Then I could also finally move from
> >> postfix-procmail-bogofilter-cron-dovecot to
> >> postfix-deliver-antispam-bogofilter-dovecot. :)
> > 
> > Hi,
> > 
> > it's not quite clear to me how this would work with bogofilter as a
> > mailbox_transport - bogofilter isn't designed to do final delivery.
> > 
> > It's also not quite clear to me why people would use procmail. Although
> > defended by its maintainers, it's an unusable and unconfigurable piece
> > of software from ancient past -- getting error handling right in
> > procmail is next to impossible, requires forfeiting :e rules and
> > bloating procmailrc with explicit error handling recipes.
> 
> You're right, and that's why I don't want to continue using it. It had a lot of
> security issues, and the syntax of procmailrc looked like a bad joke to me when
> I encountered it for the first time.

I think the syntax is not that worse if got a bit used to it. Even this
exitcode issues are just a matter of standardisation. But look at this
(taken from procmail.c):

[...]
int main(argc,argv)int argc;const char*const argv[];
{ register char*chp,*chp2;
#if 0                           /* enable this if you want to trace procmail */
  kill(getpid(),SIGSTOP);/*raise(SIGSTOP);*/
#endif
  newid();
  ;{ int presenviron,override;char*fromwhom=0;
     const char*idhint=0;gid_t egid=getegid();
     presenviron=Deliverymode=mailfilter=override=0;
     Openlog(procmailn,LOG_PID,LOG_MAIL);                 /* for the syslogd */
     if(argc)                          /* sanity check, any argument at all? */
      { Deliverymode=!!strncmp(lastdirsep(argv0=argv[0]),procmailn,
         STRLEN(procmailn));
[...]

The whole source code looks like this. I mean, who is supposed to
read this and who wrote this? I don't want to use such software, it's
a nightmare.
 
> Not being able to pipe mail through an arbitrary program surely makes sieve
> more secure, but it also makes things much more complicated sometimes. Also I
> think beginners tend to use procmail, just because in many guides / tutorials /
> howtos it's the LDA of choice. (I, for example, started out with this howto:
> http://www.gentoo-wiki.info/HOWTO_Email_System_for_the_Home_Network )
> 
> > If you want something and Dovecot's deliver doesn't fit your needs,
> > consider maildrop, <http://www.courier-mta.org/maildrop/>
> 
> I didn't even know about it until very recently. ;)

$ aptitude search ~dprocmail
[...]
p   maildrop                                                                    - mail delivery agent with filtering abilities
[...]

That's how I found it ;).
 
> > Bogofilter has an "integrating-with-postfix" document in the doc/
> > directory that shows how to use Postfix's content_filter and does not
> > need procmail. Unfortunately, it does not show how to integrate updates;
> > there are several approaches to achieve that. One way is to use separate
> > mailboxes where users can send mail to and where they are picked up by
> > cron - best when using Dovecot is probably to make users move spam into
> > particular folders via IMAP.
> 
> That's how I'm doing it, but surely the Antispam plugin is a nicer (and more
> user-friendly) approach - the classification direction (Spam->Ham or Ham->Spam)
> is determined by the source and target mailbox.

You could simply run the cron on your SPAM folder and also delete old
spam mail during that run. That's how I initially planned it.
 
> Patrick.

Regards,
Matthias-Christian


More information about the dovecot mailing list