[Exim] using fetchmail with exim daemon

Pàgina inicial
Delete this message
Reply to this message
Autor: Greg Matheson
Data:  
A: Pierre A. Humblet
CC: exim-users
Assumpte: [Exim] using fetchmail with exim daemon
Just answering the easy question, but at some length :-)

On Mon, 21 Oct 2002, Pierre A. Humblet wrote:

> Greg Matheson wrote:


> > I've been playing around with exim on Win98 behind a firewall,
> > more for fun than because I need to read email this way.


> > Using fetchmail to get mail via POP presented some problems with
> > exim running as daemon. Exim routed it right back to the
> > smarthost. I solved that with a new router above dnslookup.


> Sorry Greg, I am not sure how fetchmail works and how it interacts
> with exim. Where does it get mail from and where does it put it?


Fetchmail does POP & IMAP, getting mail from smarthosts. I have in
.fetchmailrc:

    poll ms.chinmin.edu.tw protocol pop3 port 110 authenticate ssh
        user "lang" with password "secretno1" is "greg" here
    poll mail.chinmin.edu.tw protocol pop3 authenticate ssh
        user "cid88201" with password "secretno2" is "greg" here


The man page says:

       As  each  message is retrieved fetchmail normally delivers
       it via SMTP to port 25 on the machine  it  is  running  on
       (localhost), just as though it were being passed in over a
       normal TCP/IP link.   The  mail  will  then  be  delivered
       locally  via  your system's MDA (Mail Delivery Agent, usu-
       ally sendmail(8) but your system may use a  different  one
       such  as  smail, mmdf, exim, or qmail).  All the delivery-
       control  mechanisms  (such  as  .forward  files)  normally
       available  through  your  system  MDA  and  local delivery
       agents will therefore work.


       If no port 25 listener is available,  but  your  fetchmail
       compilation  detected  or  was told about a reliable local
       MDA, it will use that MDA for local delivery instead.


Here is what is written in the headers by fetchmail and exim for
an email to me from the cygwin list:

>From cygwin-return-59929-lang=ms.chinmin.edu.tw@??? Sat Oct 19 21:48:32

+2002
Return-path: <cygwin-return-59929-lang=ms.chinmin.edu.tw@???>
Envelope-to: greg@localhost
Delivery-date: Sat, 19 Oct 2002 21:48:32 +0800
Received: from [127.0.0.1] (helo=localhost)
        by 6505.LM-1042 with esmtp (Exim 4.10)
        id H48ECT-006WG5-00
        for greg@localhost; Sat, 19 Oct 2002 21:48:29 +0800
Received: from ms.chinmin.edu.tw [140.126.111.3]
        by localhost with POP3 (fetchmail-5.9.13)
        for greg@localhost (single-drop); Sat, 19 Oct 2002 21:48:29 +0800 (TST)
Received: from sources.redhat.com (sources.redhat.com [209.249.29.67])
        by ms.chinmin.edu.tw (8.11.6/8.11.6) with SMTP id g9JDWQu04163
        for <lang@???>; Sat, 19 Oct 2002 21:32:29 +0800



Fetchmail seems to be identifying itself with a 'helo localhost'
and it looks like it wants the mail delivered to greg@localhost

Wait. I just realize that my claim about a re-routing problem
was a mistake. The mail wasn't being re-routed back out on to
the Internet. It was being BOUNCED because greg@localhost was an
unroutable address.

I THOUGHT the default router, dnslookup, was catching it and
routing it back out on to the Internet, just as it would have an
email I wrote. I guess I was confusing $sender-address
and $recipients, because of the mailing list convention of
keeping the To: header pointing to the list address.

I'm still thinking in terms of headers, rather than envelopes.

I also didn't realize that the address greg@localhost would not
automatically be recognized as a local domain.
I have added localhost to +localdomains and it seems to be
working.

domainlist local_domains = @ : localhost

[I had put some extra routers using the redirect driver
ahead of dnslookup, in the routers section, but this wasn't
necessary.]

I think this is probably useful for someone trying to use exim
and fetchmail together.

I'm CCing this to the exim list. I want to express my
appreciation of you for porting exim to cygwin.

Christmas came early this year :-)

--
Greg Matheson                    The best jokes are
Chinmin College                  those you play on
                                 yourself.
Taiwan Penpals Archive <URL: http://penpals.chinmin.edu.tw/>