Re: How getmail deals with delivery errors and with bounce e-mails
Charles Cazabon <[email protected]>
| Newsgroups | gmane.mail.getmail.user |
|---|---|
| Message-ID | <[email protected]> |
Langenxx Feld <[email protected]> wrote: > > getmail is just launching /usr/lib/dovecot/deliver (actually a symlink to > dovecot-lda) to deliver the fetched e-mails. I'm glad you got it working. > But I have not managed to generate e-mail bounces yet, when the envelope > recipient does not actually exist in Dovecot. You do not *ever* want to generate a bounce message after retrieving a message with getmail. getmail is retrieving the message from what the message sender considers the final destination of the message (the POP or IMAP server you're retrieving from is the MX for the domain, or receives the mail from the designated MX). Generating a bounce message after final delivery is already complete is wrong, and will cause problems - for you, for the sender, and possibly for postmasters of completely unrelated domains/servers. So please, don't do that. Messages that you retrieve with getmail should only: 1) be successfully delivered into a maildir, mbox, or delivery program that successfully puts the message in the correct corresponding maildir/etc. 2) be successfully delivered into a "default"/catchall maildir/etc that gets mail which could not be matched to a more specific recipient 3) be successfully delivered into a "failed" maildir/etc that holds messages for which you did not detect the correct destination, or 4) something that dumps the message to /dev/null Messages should virtually never be re-injected into an MDA via SMTP or any other method (like you would be doing if you generate bounce messages). > I mean, if getmail fetches an e-mail, and dovecot-lda errors by writing to > stderr and exiting with a non-zero status code, then getmail knows that > delivering that particular e-mail has not worked. Exactly. > getmail however does not seem able to generate a bounce e-mail itself. Or > have I missed something? You've only missed that generating a bounce after retrieval from the final SMTP destination is wrong and will cause problems. > I hope that getmail will then move to the next e-mail. For this kind of error, getmail will proceed with the next message. > Will getmail just try the failed e-mail the next time around? Yes. getmail will realize it has not successfully retrieved and delivered the mail, so it will try again the next time it sees the message. If you want getmail to ignore the message, your configured MDA needs to exit 0 (but see the documentation) to indicate the message was successfully handled. > What happens if getmail is invoked with --idle=INBOX ? Will it never retry > that failed e-mail? Or will it, only once every 30 minutes or so? That > timeout is what RFC 2177 recommends for IDLE. Sorry, IDLE was a user contribution. I've never used it. I think it would just go on to the next message. Charles -- ----------------------------------------------------------------------- Charles Cazabon GPL'ed software available at: http://pyropus.ca/software/ -----------------------------------------------------------------------