Skip to contentSkip to conversation

encoding issues with single-patch series

BUG b4 Erik Schilling 3 participants 5 messages Jun 16, 2023 – Jun 22, 2023

lore
Share & tools
lore
#0 lore raw

Earlier, I sent a patch where I tried to CC Alex Bennée. The generated mail included the header:

Content-Transfer-Encoding: 7bit

the CC header got correctly escaped, but the mail body contained the CC with UTF-8 encoding:

Cc Alex Bennée <[email protected]>

The mail got dispatched without any complaints, but then was rejected by linux-gpio with:

    <[email protected]>: host 23.128.96.18[23.128.96.18] said: 550 5.7.1
        Content-Policy reject msg: Wrong MIME labeling on 8-bit character texts.
        BF:<H 5.99033e-10>; S229768AbjFPGtM (in reply to end of DATA command)

One can reproduce it with:

git clone -b b4/msrv https://github.com/Ablu/libgpiod.git
cd libgpiod
b4 send -o /tmp/test/ --resend v1
# The generated mail includes UTF-8 in the body, # but has a 7bit header

I did a quick hack to get it resent, but not sure if that is a proper solution:

b4/ez.py +3 -0
@@ -1581,6 +1581,9 @@ def cmd_send(cmdargs: argparse.Namespace) -> None:
             else:
                 msg.add_header('Cc', b4.format_addrs(pcc))
 
+        msg.set_charset('utf-8')
+        msg.replace_header('Content-Transfer-Encoding', '8bit')
+
         send_msgs.append(msg)
 
     if endpoint:

The weird thing is that some past mails where I also CC'd him, apparently were sent with the right encoding settings automatically [1]:

Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

[1] https://lore.kernel.org/linux-gpio/[email protected]/raw

It looks like it works for a series but not for a single patch?

- Erik

#1 lore raw
Quoted 9 lines · Erik Schilling

Earlier, I sent a patch where I tried to CC Alex Bennée. The generated mail included the header:

Content-Transfer-Encoding: 7bit

the CC header got correctly escaped, but the mail body contained the CC with UTF-8 encoding:

Cc Alex Bennée <[email protected]>

Interesting. I'll check it out.

bugbot assign to me

-K

#3 lore raw
In reply to Erik Schilling
Quoted 9 lines · Erik Schilling

Earlier, I sent a patch where I tried to CC Alex Bennée. The generated mail included the header:

Content-Transfer-Encoding: 7bit

the CC header got correctly escaped, but the mail body contained the CC with UTF-8 encoding:

Cc Alex Bennée <[email protected]>

I was able to replicate this, thanks.

bugbot assign to me

-K

#4 lore raw
In reply to Erik Schilling

Konstantin Ryabitsev writes in commit cee377e23203fd12590316c96ceadae8357e7a77:

Fix wrong CTR header after 8bit cover content is mixed in

When we mix in cover content into the patch that previously only had 7bit data, re-check the new payload and set C-T-R to 8bit if the new payload is no longer ascii.

(via https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=cee377e23203)

Signature · 2 lines
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (peebz 0.1)