Home IMAP server

Todd Slater dontodd at gmail.com
Fri Dec 29 15:24:47 UTC 2006


On 12/29/06, Dotan Cohen <dotancohen at gmail.com> wrote:
> On 29/12/06, Todd Slater <dontodd at gmail.com> wrote:
> > Yes, postfix, procmail, bogofilter, and dovecot for IMAP. I also use
> > RoundCube for web access. You would be using fetchmail too, as I
> > understand.
>
> Er, for what? :) If it's for pulling the mail down from the POP3
> server, then doesn't postfix do that?

Not that I'm aware of; postfix will receive mail for domains, but it
won't go out and fetch it from other POP3 or IMAP servers.

It may be helpful for you to read up on this at
http://www.ii.com/internet/robots/procmail/qs/. That site contains
lots of links to understanding the overall email process, from MDA's,
MTA's, MUA's, etc.

> > > ALso, please tell me if I'm understanding this correctly. Postfix
> > > connects to a remote POP3 machine and pulls the mail down.
> >
> > In my case, it's just a regular mail server so postfix is listening
> > for mail connections and receives mail for my domains. But yes, you'd
> > use fetchmail to pull mail from other servers. I have used fetchmail
> > in this system as well, and it just works as it passes mail to
> > postfix, thus starting the whole process.
>
> Fetchmail give the mail to postfix? Because I thought that postfix
> goes and gets mail, and does not listen for it.
>
> > > It then
> > > passes the mail to procmail, which runs bogofilter and based on
> > > bogofilter's response, procmail puts the mail in the appropriate
> > > folder. The IMAP server then has access to it, and can serve email to
> > > your client (Tbird, Kmail, etc.).
> >
> > Exactly.
>
> Yes! One down.
>
> > > Now, when you get a spam in ham, or
> > > vice versa, you put it in a special spam->ham or ham->spam folder so
> > > that bogofilter can learn from it. Every so often, cron comes along,
> > > parses those special folders, and send the email to bogofilter so he
> > > can learn. Is that what's happening?
> >
> > Yes.
>
> Two down!
>
> > > Thank you very much for your assistance.
> >
> > There's not much tricky about this setup, but I always run into
> > trouble with postfix/procmail.
>
> Does this affect your ability to send/ receive email?

Only initially, until I check my working configs and see that I've
forgotten that mailbox_command!

> > The only required change to the postfix
> > configuration as far as I can tell is to put this in
> > /etc/postfix/main.cf:
> >
> > mailbox_command = /usr/bin/procmail -Y -a $DOMAIN
>
> I'm going to google that.
>
> > In my .procmailrc, I have my bogofilter rules:
> >
> > :0fw
> > |bogofilter -u -e -p
> >
> > :0e
> > { EXITCODE=75 HOST }
> >
> > :0
> > * ^X-Bogosity: Unsure, tests=bogofilter
> > .Unsure/
> >
> > :0
> > * ^X-Bogosity: Spam, tests=bogofilter
> > .Junk/
>
> And those I shall google as well.

I believe I pulled that directly from the bogofilter documentation,
either the man page or the site's FAQ.

> > I happen to register every mail with the db, thus the -u switch. I
> > think that once you get your server set up, you won't want to use any
> > client-side filtering at all; it's so much easier to set it up one
> > time in your procmail rc files.
>
> I intend to only register false postives/nevatives with bogofilter, as
> I believe that is all it pays attention to anyway.

Then you might do away with the -u switch, then. I believe the docs
suggest a minimum of 500 ham and 500 spam for initial training.

> > Let me know if you want to see the cron scripts.
>
> I'd love to see them, thanks!

I wrote it up at
http://webonaire.com/blog/archive/2006/12/multiuser-bogofilter-setup-with-dovecot-imap-postfix-procmail-and-cron/

Todd




More information about the ubuntu-users mailing list