From: <fet...@je...> - 2006-07-24 15:01:42
|
Hello, I have a mailserver running Postfix, Procmail, Cyrus-IMAP and a bunch of other stuff. It handles mail for users various domains obtained over SMTP. I need to pull some additional mail off some POP mail servers and I have tried to use Fetchmail to do this. I have got it working to an extent but am falling foul of the multidrop mode. I think my problems are because Fetchmail is trying to be too clever. I would like it to get ALL mail from a pop3 mailbox and forward ALL mail, unaltered, to my Postfix server listening on port 25. I don't want it to check messages, to try routing them, to change the headers, nothing. I just want it to get the mail from POP and send it to SMTP. I have stuff on Postfix, Procmail and Cyrus-IMAP that will handle validating a message so Fetchmail should not be trying to do this. Can I do this or am I missing something. Many thanks, John -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . |
From: Rob M. <rob...@gm...> - 2006-07-24 17:57:08
|
On 7/24/06, fet...@je... <fet...@je...> wrote: > I don't want it to check messages, to try routing them, to change the > headers, nothing. I just want it to get the mail from POP and send it to > SMTP. > > I have stuff on Postfix, Procmail and Cyrus-IMAP that will handle > validating a message so Fetchmail should not be trying to do this. > > Can I do this or am I missing something. You can (that's what I'm doing). What you're missing is providing us with any information to help you. So, 1) Fetchmail version 2) Contents of .fetchmailrc -- Please keep list traffic on the list. Rob MacGregor Whoever fights monsters should see to it that in the process he doesn't become a monster. Friedrich Nietzsche |
From: John <fet...@je...> - 2006-07-24 19:28:23
|
>You can (that's what I'm doing). What you're missing is providing us >with any information to help you. >So, >1) Fetchmail version Fetchmail 6.3.4 >2) Contents of .fetchmailrc I've tried so many variants of the fetchmailrc file I don't really have "one" to send. Here is what I have at the moment: set logfile /var/log/fetchmail.log set no bouncemail set postmaster root set daemon 1500 poll mail.ispmailserver.net protocol pop3 user my-username pass my-password I was previously trying: poll mail.ispmailserver.net protocol pop3 aka forwarder1.com envelope Received localdomains domain1.com domain2.com domain3.com user my-username there pass my-password to * here I had to put in aka to get mail that had been forwarded by my domain's DNS to be recognised when the Received lines were parsed. Without this I got the below error on a Bcc: fetchmail: line rejected, four.mx.forwarder1.com is not an alias of the mailserver The localdomains are my domains. This latter configuration is probably nonsense but it got me close (but not exactly) to what I am trying to do. It works for a specific case but is not really a solution. Fetchmail seems to want to change headers and this is confusing things. If I can just get it to pass stuff through verbatim then I think it'll be ok. All help is much appreciated. |
From: Rob M. <rob...@gm...> - 2006-07-24 22:21:05
|
On 7/24/06, John <fet...@je...> wrote: > Fetchmail 6.3.4 That avoids the usual "upgrade to the latest version" chant :-) > >2) Contents of .fetchmailrc <---SNIP---> > I was previously trying: > > poll mail.ispmailserver.net protocol pop3 > aka forwarder1.com > envelope Received (This is almost certainly your problem) > localdomains domain1.com domain2.com domain3.com > user my-username there pass my-password to * here That's pretty close to what I've got, and it works for me. I suspect the problem relates to the overloading of the Received header. Does your ISP use a Delivered-to or Envelope-to header? > fetchmail: line rejected, four.mx.forwarder1.com is not an alias of the > mailserver Try the options below and, if it still fails, provide the output of "fetchmail -v -v -v" for a BCC email. That email's headers would help too. > Fetchmail seems to want to change headers and this is confusing things. If I > can just get it to pass stuff through verbatim then I think it'll be ok. You probably want to add the options to "set invisible" and "no rewrite". -- Please keep list traffic on the list. Rob MacGregor Whoever fights monsters should see to it that in the process he doesn't become a monster. Friedrich Nietzsche |
From: John <fet...@je...> - 2006-07-28 00:36:46
|
Rob thanks for your suggestions. I decided to step back from the problem. I've taken a day or so to read the RFC material describing message formats and I have studied several incoming messages. I now realise I can not expect the header information to contain what I thought and have approached the problem from another angle. I now let a user's mail hit Postfix as that user and I have written a small script that scans the mail and makes a "best guess" at the intended recipient by parsing the "Received", "Envelope-to" and "X-Original-To" fields. I then deliver mail into a user folder from within Procmail by altering the argumets to the deliver script, delivering into Cyrus imap. Thanks for taking the time to respond to my query. -----Original Message----- From: fet...@li... [mailto:fet...@li...]On Behalf Of Rob MacGregor Sent: 24 July 2006 21:21 To: fet...@li... Subject: Re: [fetchmail-users] Simple fetch and forward |
From: Matthias A. <mat...@gm...> - 2006-07-28 13:54:02
|
"John" <fet...@je...> writes: > I now let a user's mail hit Postfix as that user and I have written a small > script that scans the mail and makes a "best guess" at the intended > recipient by parsing the "Received", "Envelope-to" and "X-Original-To" > fields. If your inbound server writes X-Original-To: headers, why is a script needed? -- Matthias Andree |
From: John <fet...@je...> - 2006-07-29 00:59:05
|
>If your inbound server writes X-Original-To: headers, why is a script needed? >-- >Matthias Andree Hi Matthias, X-Original-To isn't always there. If I get a mail directed at a mailing list or sent as a bcc then it isn't always obvious what the sender was. I'm using fetchmail to receive the mail and drop it to a user on my server. When my Postfix gets that mail it can add an X-Original-To but this will be the name of the account specified in the "here" clause in fetchmail conf. This is not of much use so I don't do that. I did do this originally but soon realised there was little point. When the message hits procmail, I run a little script and this extracts a likely original destination address, irrespective if it was sent Bcc or via a list, by extracting the "Received:" header containing a "for" nearest the mail's origin. Procmail then delivers the mail into a user folder based on the address that was extracted: if the mail was destined for "ad...@do..." it hits a folder called domain.com/address. This is great as it sorts all my incoming mail from various services I subscribe to (I subscribe with a unique address to each one so I can track where my address is leaked from as I get spam). I was originally trying to use Fetchmail's multidrop mode to do what I wanted but I didn't fully understand the anatomy of an email so I read the RFC and re-thought what I was doing. I don't know if I am doing this the best way, but what I've got works for me - it's just a prototype but it seems to be ok. Thanks for your interest, John |
From: Matthias A. <mat...@gm...> - 2006-07-29 15:39:19
|
"John" <fet...@je...> writes: > X-Original-To isn't always there. If I get a mail directed at a mailing list > or sent as a bcc then it isn't always obvious what the sender was. So it's not your upstream writing that header? > When the message hits procmail, I run a little script and this > extracts a likely original destination address, irrespective if it was > sent Bcc or via a list, This works in good weather, and fails in bad unfortunately. > I was originally trying to use Fetchmail's multidrop mode to do what I > wanted but I didn't fully understand the anatomy of an email so I read > the RFC and re-thought what I was doing. I don't know if I am doing > this the best way, but what I've got works for me - it's just a > prototype but it seems to be ok. The best is if your POP3 or IMAP service provider adds some reliable header, be it Delivered-To:, X-Original-To:, X-Envelope-To: or similar. If they don't, ask them if they can do that. <http://home.pages.de/~mandree/mail/multidrop> sums up requirements for multidrop in a way that is a tad less technical than a RFC. -- Matthias Andree |