fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]Fetchmail newbie

2004-06-27 04:10:29
On Sunday 27 June 2004 16:32, Brian Candler wrote:
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.
Sorry I included a wrong header. Indeed the header was added by the sendmail.
This is the one added by fetchmail
Received: from pop2.wlink.com.np [202.79.32.43]
        by localhost with POP3 (fetchmail-5.9.0)
        for root(_at_)localhost (single-drop); Sun, 27 Jun 2004 00:32:39 +0545 
(NPT)

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.
Well you are right. It can create mail loop. But I will be adding the domain 
as local thus the mails will be delivered locally in the machine where 
fetchmail is running however the MX is still the one from where the fetchmail 
retrives mail. 

This is what i want to do...
domain name: xyz.com

In the main MX server all the mails for @xyz.com will be delivered to user A
Fetchmail fetches the mail for user A from the MX server using pop3.
Then the mails will be delivered to sendmail running in local machine.
My making entries in /etc/mail/virtusertable I will then route mails to 
different mailboxes in the local machine.

I hope you understood what I want to do. Use a single pop account from my ISP 
that can be shared among different users independently.

Or is there different way to do so??

thanks,
Bikrant


Brian.