[Techtalk] a working MTA...a SIMPLE one!

Mary mary-linuxchix at puzzling.org
Wed Oct 22 15:04:30 EST 2003


sl wrote:
> Y'know I'm just gonna show this to all, cuz it seems WRONG that it
> seems to be failing cuz it's losing connection to localhost!!  This is
> the messages from fetchmail, protocol set to auto (detect).  You may
> wish to scroll down (or WhereIs) to the point where i put 5 asterisks.
> ;)

<snip>

> fetchmail: SMTP connect to localhost failed

Why do you think this is wrong?

Here's how a fetchmail/mutt setup normally works:

 Incoming mail:
  - fetchmail fetches mail from the server
  - fetchmail connects to localhost on port 25, and passes on the
    message, relying on the local MTA to deliver it

 Outgoing mail:
  - mutt calls /usr/lib/sendmail (I think) and passes the mail onto it
  - the local MTA (which is started by /usr/lib/sendmail) delivers the
    mail however it sees fit

BUT...

Really simple MTAs, like nullmailer and ssmtp, DON'T listen on port 25.
They ONLY handle outgoing mail. So if you have one of these installed,
then the error is expected.

So, what you need to do in this case (and I can't say for sure that this
is what is happening), is change your incoming mail setup to this
procedure:

 Incoming mail:
  - fetchmail fetches mail from the server
  - fetchmail passes the mail straight on to procmail rather than
    connecting to port 25

This is how my own setup works, since I use nullmailer.

The way you set up fetchmail to rely on procmail directly is by doing
something like this in your ~/.fetchmailrc

poll REMOTE_IMAP_HOST with protocol imap
    user REMOTE_USER_NAME there with password REMOTE_PASSWORD
    options mda "/usr/bin/procmail -d LOCAL_USER_NAME"

There might be some other options like "fetchall" and "nokeep" -- check
the fetchmail man page.

Alternatively, the command line equivalent of the above is:

fetchmail -m "/usr/bin/procmail -d LOCAL_USER_NAME" -p imap -u REMOTE_USER_NAME REMOTE_IMAP_HOST

-Mary


More information about the Techtalk mailing list