Be more economical with returning bodys in bounce messages
authorchrisz <chrisz@openbsd.org>
Thu, 4 May 2023 12:43:44 +0000 (12:43 +0000)
committerchrisz <chrisz@openbsd.org>
Thu, 4 May 2023 12:43:44 +0000 (12:43 +0000)
according to rfc3461 4.3

OK millert@

usr.sbin/smtpd/bounce.c

index 6028cbc..84fd035 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: bounce.c,v 1.87 2023/02/08 08:20:54 tb Exp $  */
+/*     $OpenBSD: bounce.c,v 1.88 2023/05/04 12:43:44 chrisz Exp $      */
 
 /*
  * Copyright (c) 2009 Gilles Chehade <gilles@poolp.org>
@@ -538,8 +538,8 @@ bounce_next(struct bounce_session *s)
                        if ((len = getline(&line, &sz, s->msgfp)) == -1)
                                break;
                        if (len == 1 && line[0] == '\n' && /* end of headers */
-                           s->msg->bounce.type == B_DELIVERED &&
-                           s->msg->bounce.dsn_ret ==  DSN_RETHDRS) {
+                           (s->msg->bounce.type != B_FAILED ||
+                           s->msg->bounce.dsn_ret != DSN_RETFULL)) {
                                free(line);
                                fclose(s->msgfp);
                                s->msgfp = NULL;