[wellylug] can't send mail - postfix etc

stephen stephen at vital.org.nz
Wed Sep 26 22:03:16 NZST 2007


On Wed, 2007-09-26 at 21:01 +1200, Persian wrote:

> I need postfix or sendmail as I am deeply attached to mutt and cannot
> live without it! I just keep refusing to give it up :)
> (though I have been tempted heaps of frustrating times like this) but
> I think I have it sorted now. The problem was I needed the line
> smtp.clear.net.nz in a postfix file, so yes that was the error!

OK, that clears things up a lot.

Just so you know, it isn't necessary to run postfix or sendmail or any
other MTA in your situation - you could use fetchmail to download your
mail instead. In fact, I think these days mutt can even access POP
accounts itself?

Here's the deal. (Again, apologies if this is not news to you, I'm just
reading between the lines of your previous message, maybe quite
wrongly). (And apologies to other people for the grand
over-simplification that's about to come).

Mutt is firmly in the camp of Unix programs that do one thing (well) and
one thing only. That thing is display and manipulate your mail, for your
reading pleasure, on your local machine. Such programs are called MUAs
(Mail User Agents). Mutt isn't really concerned with getting mail from
somewhere else, or delivering it to somewhere else. Mutt doesn't even
want to compose your mail for you, because other program are doing
editing well and editing only.

(Doing one thing and one thing only is an extremely useful philosophy
when you often need to do new things and can build those new things from
the beautiful interlocking component parts that Unix offers. It can be a
pain in the bum if you frequently need to do the same thing again and
again and don't like programming or scripting. This is why programmers
often really like Unix-type environments, and business people often hate
them.)

Postfix and sendmail deliver and receive mail from one machine to
another. They're MTAs (Mail Transport Agents). Typically you'd use them
if you were managing email for lots of users and needed more control
than what you can get by just using the services your ISP provides. (Or,
like a lot of people on this list, including me, you use them because
you enjoy using and tweaking software that could serve the needs of
1000s, even though there's only three people in the house.)

Because spammers are anti-social arseholes, but unfortunately CLEVER
anti-social arseholes, running an MTA is something that requires some
know-how these days, both to avoid spammers and to deal with the
measures other people are taking to avoid spammers. 

The protocol mostly used for delivery between organisations is SMTP.
Postfix and sendmail speak SMTP coming and going (they can accept mail
and deliver it). So they're MTAs, and they're also SMTP servers.

SMTP servers can accept mail for users that aren't even on their own
system. (Sort of like how the post office can accept your letter to
someone in Australia - they forward it on. But all you need to do is get
it to the post office and they take care of it after that).

Mail clients for end users just speak SMTP to deliver mail. They expect
an ISP's SMTP server to complete the job of getting the mail to its
final destination, and they use other protocols like POP and IMAP to
pick mail up from a mail box.

POP and IMAP are in common use for getting email from a central server
to a client machine. POP is what ISPs usually offer. Within
organisations, IMAP is sometimes used.

The idea behind POP is that once your machine has collected your mail
for you, it's deleted from the server, so your machine has the only
"master" of your email. That's why once you've downloaded your mail, you
can't get it again, or read it from another machine.

The idea behind IMAP is that you download copies of the mail from a
central server, but it's never deleted from the server unless you
explicitly say so - that way your mail is readable from any machine with
an IMAP client. Your mail client might stash mail details locally for
you for speed reasons, but in theory, the IMAP server at your
ISP/work/wherever is the master.

So this is why mutt alone is not enough for you. Although in recent
years mutt has learnt to speak POP and IMAP to get mail from elsewhere,
it still is rooted in the paradigm that your mail is local.  It's easier
to use mutt if something else takes care of fetching mail from your ISP
to your machine, and delivering it to your ISP.

You can use Postfix (or sendmail or exim or qmail or lord knows what) to
do the job delivering mail from your local machine to your ISP (and/or
to its ultimate destination), but running a full-on SMTP server is kind
of overkill, like driving a truck down to the post office every day. A
big, dangerous truck that you really should have an HT license for. With
one letter inside it.

Fetchmail does one thing - snagging email via POP or IMAP from a remote
mailbox and sticking it on your local machine. It's a smaller and
simpler program and doesn't present the same kind of security problems,
which is why I was thinking it might be good in your situation.

On other operating systems, programs like Outlook and Eudora and Pegasus
Mail and Entourage handle several jobs - they snag the mail from a
remote machine for you (like fetchmail), and they send your mail TO a
remote machine for delivery (like postfix or sendmail), and they let you
browse your local mail store as well (like mutt).

These days Evolution and Thunderbird and Balsa and Sylpheed do the same
kind of thing on Unix/Linux machines too. They're pretty good if you
like GUI mail programs. They are all good enough in fact that we can
have a long flame war arguing about which one exactly is best.

Back in the day when most Linux boxes were serving many users, maybe on
a local network, and ISPs were primitive, and spammers were still
figuring out how to exploit lax security, it made good sense to run a
local MTA. It doesn't make so much sense if you have one box that's just
for you and isn't on a local LAN providing services to other machines,
and no one's paying you to keep the mail going at all costs 24/7.

Anyway, if you love mutt, and things are working well for you, more
power to you, and no need to mess with a setup that works. But it helps
to understand how things are working "under the hood" if you're going to
keep working that way. Otherwise you might like more user friendly
programs that just work with your ISP's servers instead. The reason
postfix and and sendmail and co are painful is that they're written for
the needs of complicated organisations and expert mail administrators.
If you don't have those kinds of needs, and it isn't interesting or fun
for you to play with them, you might be better off with solutions aimed
at GUI desktop users.

Stephen




More information about the wellylug mailing list