On Tue, Jun 11, 2013 at 12:40:58AM +0200, Jason A. Donenfeld wrote:
> ---
>  smtpd/mda.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/smtpd/mda.c b/smtpd/mda.c
> index 23d288e..24c7442 100644
> --- a/smtpd/mda.c
> +++ b/smtpd/mda.c
> @@ -447,9 +447,15 @@ mda_imsg(struct mproc *p, struct imsg *imsg)
>  
>                       /* update queue entry */
>                       if (error) {
> -                             queue_tempfail(e->id, 0, error);
> -                             snprintf(buf, sizeof buf, "Error (%s)", error);
> -                             mda_log(e, "TempFail", buf);
> +                             if (strncmp(error, "BOUNCE:", 7) == 0) {
> +                                     error += 7;
> +                                     queue_permfail(e->id, error);
> +                                     mda_log(e, "PermFail", error);
> +                             } else {
> +                                     queue_tempfail(e->id, 0, error);
> +                                     snprintf(buf, sizeof buf, "Error (%s)", 
> error);
> +                                     mda_log(e, "TempFail", buf);
> +                             }
>                       }
>                       else {
>                               queue_ok(e->id);

I don't really like that idea:

- error is an informative string the mda will output for a user, we are
  not supposed to alter scheduling behaviour based on that;

- the "bounce:" prefix in an error message does not imply a permfail by
  any convention/standard I know. Is it ? where did you get that from ?

Can you explain what use-case you're trying to solve ?

We're probably too conservative with mda errors but I would rather see
tempfail/permfail solved by sysexits(3) than by substring of the error
message :-/


-- 
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

-- 
You received this email because you are subscribed to mailing list: 
[email protected]
To unsubscribe, send mail with subject:
        [[email protected]] unregister

Reply via email to