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

Martin Gregorie <[email protected]>
Newsgroups gmane.mail.getmail.user
Organization Martin Gregorie
Message-ID <[email protected]>
On Wed, 2020-11-04 at 15:07 +0100, R. Diez wrote:
> > How does Postfix know whether a destination address is invalid?
> >  From the aliases database set up with newaliases.
> 
man aliases tells you about everything it can do, including what it can
do with mail for a nonexistent name.

Slight memory brainfade here: I in fact use aliases to redirect mail for
login names (mainly system generated) that should never receive mail to
my main username. I've also set the 'luser' parameter to send locally
undeliverable mail to my main username rather than trying to send
'undeliverable mail' notifications to its originator.

> 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.
> 
Dunno about other MTAs, but Postfix can validate usernames against
/etc/passwd and can be configured to use a local address for unknown
recipients rather then attempting to report nondelivery.
 
> 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."
> 
All this stuff is done by Postfix, so Dovecot is left to get on with
delivering incoming mail to other hosts on my LAN. 

This is the norm: I only use the keyboard on the machine hosting
getmail, the main Postfix instance and Dovecot when its rebooted after a
software update. I'm normally using a laptop in another room, so thats
where I want to read mail from by using the Evolution MUA that gets its
mailfeed from Dovecot. Similarly, If I need to install stuff or develop
code on the getmail host, its easier to ssh into it from this laptop. 

> What are you actually doing if dovecot-lda fails? For example, if the
> recipient mailbox does exist, but is full.
> 
Fix it, of course, probably via an ssh login because that host only has
an SVGA display while the laptop is (a) faster and (b) has a 1600x900
display. That said, my laptops are set up so they can also be used away
from home using a direct link to my ISP, which is configured, unlike
getmail, to leave email thats been read in the ISP's POP3 mailbox.

> 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.
> 
Correction: that's not how it works.

- if getmail can't read a message in the ISP's POP3 mailbox, it gets
  left there and will eventually get read once the problem has been
  fixed: this eway no mail is lost.

- postfix leaves mail in user's mailboxes /var/spool/mail

- undelivered mail remains in these mailboxes until an MUA request
  causes Dovecot to deliver it 

> 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?
>
a) getmail generates error messages which ARE delivered normally
b) You can always point your favourite MUA at the ISP's POP3 mailbox
   and see whats there. This doesn't delete messages unless you request
   them to be deleted or configure your MUA to delete them.
 
> 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?
>
Yes.

>  If that is the case, why bothering with an alias look-up in the first
> place?
> 
Convenience, because this way I *know* that there's no unread mail
lurking in mailboxes belonging to seldom-visited logins.

> 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).
> 
Ask somebody who uses those: they are for high volume use. Small volume
mail users don't need them or any MX records.
 
>  > [...]
>  > 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?
> 
NO! My MTA is not accessible from outside because it only sends mail.
Making it so is the reason I use getmail.

Martin
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.