fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]Fetchmail newbie

2004-06-27 03:51:42
On Sun, Jun 27, 2004 at 01:09:43PM +0545, Bikrant wrote:
Hi... I am trying to retrive mails using fetchmail and then deleiver it 
locally using sendmail. I found that fetchmail adds the following header in 
every messages that it retrives from the pop server.

Received: from localhost (localhost.localdomain [127.0.0.1])
        by localhost.localdomain (8.12.5/8.12.5) with ESMTP id i5QIldIr030563
        for <root(_at_)localhost>; Sun, 27 Jun 2004 00:32:39 +0545

Nope, fetchmail doesn't add any such header. If you notice:

  by localhost.localdomain (8.12.5/8.12.5)
                            ^^^^^^^^^^^^^
that's your version of *sendmail* and it's sendmail which is adding this
header.

I am running fetchmail as root user so it has modified the recepient to 
root(_at_)localhost(_dot_) Isn't there any way so that fetchmail retains the 
original 
recepient ? I tried  -n and --invisible options but they didn't help.

Yes there is, but it's probably not what you want. fetchmail opens an SMTP
connection to your local sendmail daemon and uses
  MAIL FROM:<..whatever..>
  RCPT TO:<root(_at_)localhost>
to deliver to root's mailbox. If it did
  MAIL FROM:<..whatever..>
  RCPT TO:<you(_at_)yourdomain(_dot_)com>

where you(_at_)yourdomain(_dot_)com is the original recipient, then in most 
cases
sendmail will simply open a connection to your external mailserver (where
the POP3 message came from) and re-deliver it there.

That's unless you implement some dangerous hacks so that your local machine
believes that yourdomain.com is local, when clearly it isn't, because the MX
records for yourdomain.com point to a remote machine.

Brian.