Prev: Help using dd
Next: flashplayer-nonfree and multiple cores
From: Denis McMahon on 6 Dec 2009 05:06 Ok, I'm having some sort of mental block here. Can I run spamassassin as a transparent proxy on my pop3 grabs with thunderbird, or would I need to grab mail with eg fetchmail, pipe it through spam assassin and then deliver it to thunderbird using a localhost pop3 or smtp method? I see that thunderbird can pick up the local mailspool, and use the designated isp smtp smarthost for outgoing, but I'm not 100% sure how it would all hook together. Rgds Denis McMahon
From: Martin Gregorie on 6 Dec 2009 07:27 On Sun, 06 Dec 2009 10:06:33 +0000, Denis McMahon wrote: > Can I run spamassassin as a transparent proxy on my pop3 grabs with > thunderbird, or would I need to grab mail with eg fetchmail, pipe it > through spam assassin and then deliver it to thunderbird using a > localhost pop3 or smtp method? > I think the latter, since you can only use a pipe to pass mail to SA: it doesn't understand POP3/IMAP or SMTP protocols. IME you should use getmail rather than fetchmail - if the latter has its session closed by the ISP's mail server it leaves the mail sitting in the ISP's mailbox forever and marked as 'seen'. You don't get dups but equally you do have to periodically go in and clear it out. To give you some idea of how to put the rig together, heres how my setup works. I'm doing pretty much what you want, but with a private MTA in the loop. I can't get my head round configuring sendmail (and the O'Reilly book is incomplete junk) so I use Postfix instead. Here's the setup: ISP--POP3-->getmail | spamc | spamkiller | sendmail ----+ ^ | | +------SMTP-----------------+ | V +------SMTP------------ Postfix--- Local mailbox ^ | | | | v | Thunderbird Dovecot | | | | | POP3 | | | | V v +--SMTP- -+<----Evolution I use Evolution, but not on the same host as Postfix, which is why I need to run Dovedot. As the diagram shows if you're running Thunderbird on the same host as your MTA it should simply read from the local mailboxes your MTA delivers mail to. In either case, you send outbound mail to the MTA for either local delivery to another user or for external delivery via your ISP's smarthost. getmail uses a script as its local delivery agent. My script contains the pipeline: spamc | spamkiller | sendmail to process incoming mail and deliver it to Postfix: - spamc is part of SA: it delivers messages to the spamd daemon, accepts the marked-up message and passes that on. Running spamc/spamd is much faster than simply using spamassassin because there's no per-message start/stop overhead. - spamkiller is my own code. It silently drops mail that SA has marked as spam - sendmail is a Postfix utility that receives mail on stdin and delivers it to Postfix via SMTP. Its called sendmail to avoid breaking other programs: all UNIX programs that can send mail call sendmail to do so. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
From: Denis McMahon on 6 Dec 2009 15:57 Martin Gregorie wrote: > To give you some idea of how to put the rig together, heres how my setup > works. Thanks, at least I think I know what I need to do now. I believe I can use the following chain: Demon / Googlemail mailboxes ---> POP3 ---> getmail | spamc | sendmail ---> SMTP localhost ---> Postfix -> Local mailbox -> Thunderbird ---> SMTP ---> ISP outgoing smarthost Does that make sense to you? Presumably I use the "unix movemail" server type. The thunderbird -> isp smarthost for outgoing mail already works, and saves me setting up postfix to do that bit. Off to read getmail and postfix instructions I guess. Rgds Denis McMahon
From: Martin Gregorie on 6 Dec 2009 17:40 On Sun, 06 Dec 2009 20:57:30 +0000, Denis McMahon wrote: > Martin Gregorie wrote: > >> To give you some idea of how to put the rig together, heres how my >> setup works. > > Thanks, at least I think I know what I need to do now. I believe I can > use the following chain: > > Demon / Googlemail mailboxes > ---> POP3 ---> > getmail | spamc | sendmail > ---> SMTP localhost ---> > Postfix -> Local mailbox -> Thunderbird > ---> SMTP ---> > ISP outgoing smarthost > > Does that make sense to you? Presumably I use the "unix movemail" server > type. > Yes, that should work, though I'd still run the outbound through Postfix for tidiness. Its only one directive in main.cf - here's mine: relayhost = smtp.ukfsn.org > Off to read getmail and postfix instructions I guess. > Getmail is pretty straight forward to set up - you'd just configure a receiver for each mail source. The main documentation for getmail and Postfix is on their web sites. Read up on postconf too - its a most useful debugging tool if the config doesn't do quite what you wanted. Just in case you don't know about it, be sure to read up on the 'alternatives' command too. Its used by most Linuxes to switch between the various MTAs and any other major system components which have a number of widely accepted alternative implementations. Follow this order: - Install and configure Postfix - Set the run levels that you want for Postfix (2-5). - Set the runlevels for sendmail (none). - Stop sendmail - Use alternatives to make Postfix the default MTA. - Start Postfix In Fedora daemons are started and stopped with the 'service' command and 'chkconfig' is used to adjust the runlevels at which daemons are active. These levels control what happens during boot and shutdown. Other distros may use different but equivalent tools for these jobs. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
From: Martin Gregorie on 6 Dec 2009 17:46
On Sun, 06 Dec 2009 22:25:57 +0000, Ivor Jones wrote: > On 06/12/09 12:27, Martin Gregorie wrote: >> On Sun, 06 Dec 2009 10:06:33 +0000, Denis McMahon wrote: >> >>> Can I run spamassassin as a transparent proxy on my pop3 grabs with >>> thunderbird, or would I need to grab mail with eg fetchmail, pipe it >>> through spam assassin and then deliver it to thunderbird using a >>> localhost pop3 or smtp method? >>> >> I think the latter, since you can only use a pipe to pass mail to SA: >> it doesn't understand POP3/IMAP or SMTP protocols. >> >> IME you should use getmail rather than fetchmail - if the latter has >> its session closed by the ISP's mail server it leaves the mail sitting >> in the ISP's mailbox forever and marked as 'seen'. You don't get dups >> but equally you do have to periodically go in and clear it out. > > Which isn't necessarily a bad thing. I filter all my mail via Google for > two reasons; firstly the spam filtering is very good and secondly it > *does* keep stuff forever. More than once I've deleted something by > mistake. A friend recently lost mail she wanted to keep from her > "Deleted" folder - I tried in vain to tell her that putting stuff you > *don't* actually want to delete there wasn't a particularly good idea. > I run my own PostgreSQL-based mail archive, automatically fed from Postfix via the magic of the 'always_bcc' directive. Its benefits are: - spam isn't archived - effectively unlimited archival storage - fast searching and retrieving by any combination of address, subject, date range and body text. I'm planning to make it available shortly: details can be found at www.libelle-systems.com -- martin@ | Martin Gregorie gregorie. | Essex, UK org | |