Workflows Archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: users@linux.kernel.org, workflows@vger.kernel.org
Subject: Re: PSA: nullmailer should be avoided
Date: Wed, 10 Jan 2024 11:47:46 -0600	[thread overview]
Message-ID: <CAL_JsqKpxM36=cByzWzv-_peqG5EYzByk+SSJv-c=4iFRQxcrw@mail.gmail.com> (raw)
In-Reply-To: <20240109-alluring-fanatic-manul-cfa5d2@lemur>

On Tue, Jan 9, 2024 at 3:47 PM Konstantin Ryabitsev
<konstantin@linuxfoundation.org> wrote:
>
> Hi, all:
>
> I know some of you use nullmailer for sending outgoing mail, but it *really*
> must be avoided, as the messages it sends are not RFC-2822 compliant. Per that
> RFC, header lines MUST NOT be longer than 998 characters in length, which is
> not something nullmailer appears to be paying any attention to.
>
> Some mailservers will outright reject messages with lines exceeding 998
> characters (Exim), and some will force-insert <CR><LF><SPACE> at exactly
> character 998, regardless of what that does to the header:
>
> https://lore.kernel.org/linux-kernel/20240109171807.GA2783042-robh@kernel.org/raw
>
> You will notice, that the enforced line-break cuts across the email address:
>
>        Cc: [...] Sergey Shtylyov <s.shtyl
>         yov@omp.ru>
>
> A message with such header *may* get delivered, or it may get rejected due to
> malformed headers (e.g. Exim does that by default). Anyone then attempting to
> reply to such message will likely have trouble as well.
>
> Unfortunately, nullmailer appears to always re-parse To/Cc headers, so even if
> the original email properly wrapped the recipients headers before it was fed
> to nullmailer, everything will then just be concatenated into one long line:
>
> https://github.com/bruceg/nullmailer/blob/master/src/inject.cc#L384

FWIW, I hacked up this fix. I'd really prefer that it not reformat
lines at all or wrap at 72 chars, but this was the easiest fix.
(Obviously, I'm not using it either ATM)

diff --git a/lib/address.cc b/lib/address.cc
index 43fae44cf331..4db63404f6fc 100644
--- a/lib/address.cc
+++ b/lib/address.cc
@@ -585,7 +585,7 @@ RULE(mailboxes)
     result r2 = match_mailbox(node);
     if(!r2) break;
     r1.next = r2.next;
-    r1.str = r1.str + ", " + r2.str + r2.comment;
+    r1.str = r1.str + ",\n " + r2.str + r2.comment;
     r1.addr += r2.addr;
   }
   node = skipcomment(node, r1.str);
@@ -638,7 +638,7 @@ RULE(addresses)
     result r2 = match_address(node);
     if(!r2) break;
     r1.next = r2.next;
-    r1.str = r1.str + ", " + r2.str + r2.comment;
+    r1.str = r1.str + ",\n " + r2.str + r2.comment;
     r1.addr += r2.addr;
   }
   node = skipcomment(node, r1.str);
diff --git a/src/inject.cc b/src/inject.cc
index 0a555b212fb9..851a1fda5f17 100644
--- a/src/inject.cc
+++ b/src/inject.cc
@@ -381,7 +381,7 @@ mystring make_recipient_list()
   bool first = true;
   for(slist::iter iter(recipients); iter; iter++) {
     if(!first)
-      result = result + ", " + *iter;
+      result = result + ",\n " + *iter;
     else
       result = *iter;
     first = false;
>
> I'll open an issue with nullmailer about this, but the project doesn't appear
> very alive, so your best bet is to switch to msmtp. It has
> msmtp-{enqueue,listqueue,runqueue} commands that will do everything nullmailer
> can do and won't break your mail.

My issue was the queuing is not part of msmtp, but add-on scripts of
unknown robustness and maintenance.

Rob

      reply	other threads:[~2024-01-10 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 21:47 PSA: nullmailer should be avoided Konstantin Ryabitsev
2024-01-10 17:47 ` Rob Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL_JsqKpxM36=cByzWzv-_peqG5EYzByk+SSJv-c=4iFRQxcrw@mail.gmail.com' \
    --to=robh@kernel.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=users@linux.kernel.org \
    --cc=workflows@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).