Re: How getmail deals with delivery errors and with bounce e-mails

"R. Diez" <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <[email protected]>
> Dead simple. From my getmail script:
> /usr/sbin/sendmail -i -f "$sender" -- MYUSER
 > [...]

Brilliant, thanks for the example.


>> How does Postfix know whether a destination address is invalid?

>  From the aliases database set up with newaliases.

I would have thought that dovecot-lda (the internal MDA) would be the one saying that the recipient address is invalid, at least for 
*@example.com recipients.

But OK, I guess I can somehow regenerate the Postfix alias database from the Dovecot user and alias database when I add a new mailbox or 
e-mail alias to the internal mail server.

But is it really worth doing all that? You said:

"Any mail with an invalid destination address is redirected to my main personal mailbox by Postfix. My choice: I configured it to do this."

Wouldn't it be easier and safer then if getmail (or perhaps Postfix in your case), tries dovecot-lda (the internal MDA) without looking at 
any alias database for any *@example.com address, and any e-mail that fails to get delivered, for whatever reason, gets redirected to your 
personal mailbox?

This way, you do not need to maintain a Postfix alias database for all *@example.com addresses. Other aliases, like local root users in some 
hosts, will probably be fairly static in comparison (manual editing instead of regeneration scripts).

What are you actually doing if dovecot-lda fails? For example, if the recipient mailbox does exist, but is full.

If getmail is trying to deliver and dovecot-lda fails, it will leave the message in the external POP3 mailbox. OK, it will complain, but it 
will carry on with the next message. So it is not a final complain.

How will you find out that some inbound mails are forever stuck in the external POP3 mailbox, because getmail fails to deliver them every 
time? Or do you have a clever solution in place like this? [dovecot-lda -> error status code + stderr -> internal mail to root (like cron) 
-> your personal mailbox]

If Postfix is the one trying to deliver with dovecot-lda, the alias check succeeds but the actual delivery fails, what happens then? Do you 
get an internal bounce mail on your personal e-mail account? If that is the case, why bothering with an alias look-up in the first place?


> If you haven't already read the Postfix documentation, than I suggest
> you do so. Its rather complete and well written. Like all MTAs, Postfix
 > [...]

Believe me, I have, to a more than reasonable extent. I would only come to an Internet mailing list full of adorable experts as the very 
last resort. ;-)


>> Or does the SMTP mail server at my provider always take the whole e-
>> mail, and then discard it (because the recipient e-mail address is
>> unknown) and finally generate a bounce e-mail itself?
>>
> Depends how its configured, but more likely to bounce it as
> undeleverable.

This point is not entirely clear yet. But in the meantime, I have gathered that the receiving SMTP server (the one pointed at by the DNS MX 
record of the example.com domain I bought) would normally not generate a bounce e-mail, but report the recipient address as invalid inside 
the SMTP connection from the sending client (the connection is still up during the recipient address check).

That means that the relaying SMTP server the Mail User Agent is using will be the one generating the bounce mail, right? Not the MX SMTP 
server in my hosting provider for my [email protected] domain.

In other words, if I have understood this right, one would then say that an MX SMTP server will never generate any bounce mails for any 
inbound e-mails with an invalid recipient address, correct?


 > [...]
 > Accepts outbound messages from hosts on my LAN and forwards them via my ISP to external recipients.

I am curious here. Do you have an open SMTP relay inside your LAN? Or did you actually password-protect it and configure it to use SSL/TLS 
inside your LAN? Did you set up an account per LAN host?

Even if you configure Postfix to listen only on localhost, anybody with an unprivileged local account could send mails then. Well, one could 
be relatively sure about the LAN, but I'm just curious.

Regards,
   rdiez
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.