bruceg/nullmailer — Issue #1: nullmailer ignores permanent SMTP errors
Author: clopez
Created: 2012-01-11 15:02:24+00:00
State: open

Hello,

I am a happy user of nullmailer.

However when an email in the queue cannot be sent because of permanent failure (wrong recipient for example) nullmailer continues trying to send the email forever. It would be desirable to implement in nullmailer the capability to delete from the queue the mails that where rejected with permanent failure status.

Here is a proposed way to fix the issue, but feel free to do as you think is best:

Brian Ristuccia at http://bugs.debian.org/329192 wrote:

> Nullmailer retries unsuccessful deliveries forever. As a result, the queue
> directory can become very large over time. Since no delivery status
> notification is sent for failures, a user who accidentally misenters an
> address will have a tough time figuring out what went wrong. Since the
> output of mailq doesn't include the envelope addresses of the queued
> messages, this problem becomes particularly troublesome to debug for users
> without administrative access.
>
> For temporary failures, some code needs to be added to check the age of the
> queue file. If the queue file is older than a week (perhaps configurable in
> /etc/nullmailer/queuelifetime), the temporary failure should be treated as
> permanent.
>
> For permanent failures, nullmailer should queue a bounce message from the
> null envelope sender to the failed message's envelope sender. Once the
> bounce has been successfully queued, nullmailer should delete the original
> message be deleted from the queue. If queueing of the bounce message fails
> for any reason, the original message must not be removed - to do so would
> cause mail to be lost silently. As a special case, if the envelope sender of
> the failed message is null, nullmailer should give the option to either move
> the message from the queue to a special double bounce directory, or to
> override the envelope sender of the bounce message to the special address
> <#@[]> and the recipient to an administrative address (perhaps configured
> using /etc/nullmailer/doublebouncehost and /etc/nullmailer/doublebounceto).
> In the case of a grave misconfiguration where delivery of a message with the
> special envelope sender <#@[]> fails, nullmailer should log an error and
> delete the message from the queue.

Thanks!