Add Message-Id as needed for messages received on the submission port.
authormillert <millert@openbsd.org>
Mon, 9 Oct 2023 20:55:32 +0000 (20:55 +0000)
committermillert <millert@openbsd.org>
Mon, 9 Oct 2023 20:55:32 +0000 (20:55 +0000)
Since listener->port is in network byte order we need to compare
against htons(587).  The fix for this got dropped in the rewrite
in revision 1.335.

usr.sbin/smtpd/smtp_session.c

index 470b86b..ca21c5b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: smtp_session.c,v 1.435 2023/06/23 18:32:28 op Exp $   */
+/*     $OpenBSD: smtp_session.c,v 1.436 2023/10/09 20:55:32 millert Exp $      */
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -2624,7 +2624,7 @@ smtp_tx_dataline(struct smtp_tx *tx, const char *line)
 
                case RFC5322_END_OF_HEADERS:
                        if (tx->session->listener->local ||
-                           tx->session->listener->port == 587) {
+                           tx->session->listener->port == htons(587)) {
 
                                if (!tx->has_date) {
                                        log_debug("debug: %p: adding Date", tx);