Package: mmh
Severity: normal

Dear Maintainer,

mmh sometimes generates boundary separators in multipart messages with
non-ascii symbols in it. Not sure about RFC-compliance, but at least
Python standard library does not work well with them.

Here is example of problematic separator:

        --21189_ĵaŭ_Maj__2_15_03_59_UTC_2019

Notice non-ascii "ĵ" letter. The separator looks like output of date(1)
(my locale is eo.utf-8).

According to my investigation, such boundary is generated in mhsign.sh
script, newboundary() function, line 185 (in mmh=0.4 release), which
have following line:

        b=$$_`date|sed 's/[ :   ]/_/g'`

I think the simpliest fix would be using C locale for date. Patch is
attached. Not sure, whether it is safe to export LC_ALL=C at top of
script.

From 063686f0e94067edfbc44cb58bc2404b326f8754 Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov <kact...@debian.org>
Date: Fri, 3 May 2019 18:37:19 +0000
Subject: [PATCH] Ensure that multipart message boundaries are ascii-only

---
 uip/mhsign.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uip/mhsign.sh b/uip/mhsign.sh
index 894ca5e..44b3870 100755
--- a/uip/mhsign.sh
+++ b/uip/mhsign.sh
@@ -182,7 +182,7 @@ fixheaders() {
 
 ### newboundary -- output a suitable boundary marker
 newboundary() {
-       b=$$_`date|sed 's/[ :   ]/_/g'`
+       b=$$_`LC_ALL=C date|sed 's/[ :  ]/_/g'`
        for i in 0 x '=' _ + , Z 9 4 ; do
                if grep "^--$b" $TEMP/body >/dev/null 2>&1 ; then
                        ## oops, bad boundary -- try again

-- 
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Attachment: pgpVw_j2n_1Q9.pgp
Description: PGP signature

Reply via email to