1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-08 17:51:57 +00:00

Distinguish between permanent and transient errors

This patch makes the queue and couriers distinguish between permanent and
transient errors when delivering mail to individual recipients.

Pipe delivery errors are always permanent.

Procmail delivery errors are almost always permanent, except if the command
exited with code 75, which is an indication of transient.

SMTP delivery errors are almost always transient, except if the DNS resolution
for the domain failed.
This commit is contained in:
Alberto Bertogli
2016-09-24 02:02:55 +01:00
parent 0dc93d1ec6
commit 0bf5d9b242
8 changed files with 111 additions and 53 deletions

View File

@@ -5,5 +5,7 @@ package courier
// It is implemented by different couriers, for both local and remote
// recipients.
type Courier interface {
Deliver(from string, to string, data []byte) error
// Deliver mail to a recipient. Return the error (if any), and whether it
// is permanent (true) or transient (false).
Deliver(from string, to string, data []byte) (error, bool)
}