On Saturday 02 September 2006 19:25, marc wrote: > Hi, > > I want to grab emails for a whole domain (fred.com) from a mailbox - > either POP3 or IMAP, either will do - and forward to Postfix on the > local domain (insidefirewall.blah) and have the emails distributed to > the appropriate local accounts. Postfix is set-up with mostly with > virtual accounts - and a few local /Maildir accounts, as you'd expect. > > I've had a look at getmail and fetchmail, but can't understand the > required config to make this work. > > I've no problem connecting to the mail server with, say: > > poll mail.fred.com with protocol pop3 > user [EMAIL PROTECTED] there with password "pa55werd" > > but this, of course, dumps everything into one local email account. > > I also tried the likes of: > > poll mail.fred.com with protocol pop3 no envelope localdomains > insidefirewall.blah > user [EMAIL PROTECTED] there with password "pa55werd" to * here > smtphost localhost > > but this retains the original domain on emails, so sets up an email loop > when Postfix re-relays the emails. > > I understand that I can do what I want one account at a time, but that > simply increases the admin required in the setup by a couple of orders > of magnitude. This is not an option. > > The fetchmail docs are close to impenetrable, which doesn't help. The > getmail docs are much, much better, but, as I read them, getmail doesn't > write to SMTP:25, only directly to Maildir or mbox. > > Is there a sane way to do this?
I am not sure its fetchmail that is your problem. Here is my fetchmailrc (with the password removed). The first account is a catchall and will have mails addressed to anyone in my system - the * is the key here, the other four are specific accounts which I pass on to. Exim is the system that picks up the accounts from there So here is fetchmailrc # $Id: fetchmailrc,v 1.1 2002/11/11 19:16:22 alan Exp $ # Created by AKC 14th July 2000 set daemon 1800 set syslog # poll imap.blueyonder.co.uk no dns proto IMAP tracepolls aka blueyonder.co.uk localdomains chandlerfamily.org.uk libdebate.org user "ac003a3222" password "x" forcecr is * fetchall expunge 8 smtpaddress chandlerfamily.org.uk user "ac003a3222_2" password "x" forcecr is sarah fetchall smtpaddress chandlerfamily.org.uk user "ac003a3222_3" password "x" forcecr is emily fetchall smtpaddress chandlerfamily.org.uk user "ac003a3222_4" password "x" forcecr is carrie fetchall smtpaddress chandlerfamily.org.uk user "ac003a3222_5" password "x" forcecr is alan fetchall smtpaddress chandlerfamily.org.uk Hope you can use it as an example for you -- Alan Chandler http://www.chandlerfamily.org.uk -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]