F20 Where's my system mail?

Heinz Diehl htd at fritha.org
Sat Apr 19 08:47:05 UTC 2014


On 18.04.2014, Timothy Murphy wrote: 

> When I said "mail is sent to" above I should have said "which goes to"
> as I was simply quoting your explanation above.
> But I'm still puzzled by mydestination.

The direction in which the mail goes does not matter, actually. When a
mail "hits" your postfix, it will try to deliver it locally when the
recipient matches "mydestination" in any way.
 
> In my case I've actually added everything postfix could possibly want: 
> mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

It's not postfix which wants anything here. You have to decide which
mail you want it to deliver locally.
 
> But what is fritha.org in your case?
> Is that your domain?

Yes. I used my own domain in the examples in my mails.

> So could you equally well have written
> mydestination = $mydomain
> which you presumably defined earlier?

It depends. When you e.g. receive mail via a script locally, they will
most probably not have the FQDN. You have to tell postfix that these
mails should be delivered locally, and you can do that by adding
"localhost" and "myhostname". See "aliases", too.

> Am I rignt in thinking that fetchmail actually passes the email 
> on to postfix's sendmail-emulator?

Judging from the header fragments you posted, I'm shure that your fetchmail
connects to your postfix via localhost on port 25. You could avoid
that step by telling fechmail to deliver your mail to "something else"
(see the "mda" option). Here's an example (from my own setup).

I'm polling mail from a pop3 server, which gets delivered directly to
procmail. Procmail invokes CRM114 (configured as a spam filter), sorts
the mail and finally delivers it into the respective maildirs, where
mutt picks them up when reading. No postfix involved, because it's not neccessary.

Mail I send is delivered to postfix on localhost (via mutt),
which connects with my uplink (smarthost) and pushes the mail
out.

> Postfix has delivered the email to alfred.gayleard.eu
> (which happens to be the hostname of the machine postfix is running on)
> because I specified this as mydestination - 
> and then postfix has added one or two headers to say that it has done this?

Yes. Your postfix is set up to be the final destination for your
domain/host. Postfix recognizes this mail to be delivered locally.
Btw: the "Received:" headers are the only ones which can not
be completely faked by e.g. spammers, because they are added by the
processing MTA after the mail is sent.

> Actually, I wouldn't say that postfix "finally delivers these mails" to me,
> since I'm also running amavis and dovecot,
> and the mail finishes up on ~/maildir
> from which I collect it with KMail on my laptop.

Postfix delivers your mail to what you have specified in
"home_mailbox" after processing, in your case. What you do with it afterwards is out
of reach for postfix, which regards your mail as delivered when it's send to "home_mailbox".

Maybe I begin to understand what confuses you: 
don't think of mail only going into two directions (in/out) when you think of a
fully-fledged MTA as e.g. postfix, exim, sendmail and
similar. Otherwise, you miss "through". The MTA can not know if mail
which comes "in" (fetchmail) or shall "out" (mail you send) should go
these ways unless you told it explicitely. This is why mydestination, the
smarthost and other parameters are crucial. You could e.g. set up 
postfix solely as a relay/mail gateway.



More information about the users mailing list