From a289a3e771c31bd86617d47a628e459f5c7385e9 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Fri, 17 Feb 2023 21:58:05 +0100 Subject: [PATCH] when delivery fails due to missing 8bitmime/smtputf8 extensions, make it temporary failure if you start delivering, openbsd's spamd will not announce 8bitmime support. but once you get patched through to the actual mail server, it will likely announce 8bitmime support. perhaps we should also just attempt to deliver 8bit email without 8bitmime extension. probably better for users than not even trying to send the message. perhaps in a non-strict mode. --- smtpclient/client.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/smtpclient/client.go b/smtpclient/client.go index 722abe0..5282c70 100644 --- a/smtpclient/client.go +++ b/smtpclient/client.go @@ -583,11 +583,14 @@ func (c *Client) Deliver(ctx context.Context, mailFrom string, rcptTo string, ms } if !c.ext8bitmime && req8bitmime { - c.xerrorf(true, 0, "", "", "%w", Err8bitmimeUnsupported) + // Temporary error, e.g. OpenBSD spamd does not announce 8bitmime support, but once + // you get through, the mail server behind it probably does. Just needs a few + // retries. + c.xerrorf(false, 0, "", "", "%w", Err8bitmimeUnsupported) } if !c.extSMTPUTF8 && reqSMTPUTF8 { // ../rfc/6531:313 - c.xerrorf(true, 0, "", "", "%w", ErrSMTPUTF8Unsupported) + c.xerrorf(false, 0, "", "", "%w", ErrSMTPUTF8Unsupported) } if c.extSize && msgSize > c.maxSize {