Index | Thread | Search

From:
Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>
Subject:
Minor patch for spamd.c
To:
tech@openbsd.org
Date:
Mon, 1 Apr 2024 14:53:44 +0200

Download raw body.

Thread
Hi,

there is an interopation problem involving spamd.c. I attach a patch to fix 
it.

Suppose a message requires the SMTPUTF8 extension (see RFC 6530 and more), 
and the the sender and recipient both have that, but the path includes 
grelisting/spamd. The sender's MTA will connect, issue EHLO, see that spamd 
does not list the SMTPUTF8 extension, fail, and send a DSN back to the 
sender.

If the sender instead tries to connect a few times, all will be well. But 
well-behaved senders don't do that.

The attached patch should be enough.

It's not clear to me whether 8BITMIME is really necessary. Shouldn't hurt, 
though, and conceptually sending unencoded UTF8 requires 8BITMIME, even if 
senders don't generally bother with testing.

Arnt
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index f2f19b35136..380db33b39a 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -845,6 +845,8 @@ nextstate(struct con *cp)
 				    match(cp->ibuf, "EHLO")) {
 					snprintf(cp->obuf, cp->osize,
 					    "250-%s\r\n"
+					    "250-8BITMIME\r\n"
+					    "250-SMTPUTF8\r\n"
 					    "250 STARTTLS\r\n",
 					    hostname);
 					nextstate = 7;