Subject: contains circled digits or half-width kanas and encoded in ISO-2022-JP
When Subject: contains circled digits or half-width kanas and encoded in ISO-2022-JP, the mail for a listis is silently discarded. The mail is not delivered to list members, and no bounce mail is sent to the sender.
I sent a mail with a circled digit like:
$ SUBJ=`echo '①' | nkf -j -M`
$ echo $SUBJ
=?ISO-2022-JP?B?GyRCLSEbKEI=?=
$ echo test | mail -s $SUBJ -r user1@example.org testml@list1.example.com
Below messages are produced in mailman.log:
May 17 07:38:44 2022 (1700) ACCEPT: <20220517073843.97D003ECBE@ip-172-30-11-22.ap-northeast-1.compute.internal>
May 17 07:38:45 2022 (1708) Uncaught runner exception: 'iso2022_jp' codec can't decode bytes in position 3-4: illegal multibyte sequence
May 17 07:38:45 2022 (1708) Traceback (most recent call last):
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/core/runner.py", line 176, in _one_iteration
self._process_one_file(msg, msgdata)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/core/runner.py", line 269, in _process_one_file
keepqueued = self._dispose(mlist, msg, msgdata)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/runners/pipeline.py", line 37, in _dispose
process(mlist, msg, msgdata, pipeline)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/core/pipelines.py", line 50, in process
handler.process(mlist, msg, msgdata)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/handlers/subject_prefix.py", line 175, in process
subject = make_header(decode_header(subject))
File "/usr/lib/python3.8/email/header.py", line 174, in make_header
h.append(s, charset)
File "/usr/lib/python3.8/email/header.py", line 295, in append
s = s.decode(input_charset, errors)
UnicodeDecodeError: 'iso2022_jp' codec can't decode bytes in position 3-4: illegal multibyte sequence
May 17 07:38:45 2022 (1708) SHUNTING: 1652773125.2787478+48851209273ce6d2099e90af7bec42e15bd3d09e
Similarly, I sent a mail with half-width kanas like:
$ SUBJ=`echo 'テスト' | nkf -jx -M`
$ echo $SUBJ
=?ISO-2022-JP?B?GyhJQz1EGyhC?=
$ echo test | mail -s $SUBJ -r user1@example.org testml@list1.example.com
mailman.log:
May 17 07:39:15 2022 (1700) ACCEPT: <20220517073915.2CF803ECBE@ip-172-30-11-22.ap-northeast-1.compute.internal>
May 17 07:39:16 2022 (1708) Uncaught runner exception: 'iso2022_jp' codec can't decode bytes in position 0-2: illegal multibyte sequence
May 17 07:39:16 2022 (1708) Traceback (most recent call last):
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/core/runner.py", line 176, in _one_iteration
self._process_one_file(msg, msgdata)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/core/runner.py", line 269, in _process_one_file
keepqueued = self._dispose(mlist, msg, msgdata)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/runners/pipeline.py", line 37, in _dispose
process(mlist, msg, msgdata, pipeline)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/core/pipelines.py", line 50, in process
handler.process(mlist, msg, msgdata)
File "/opt/mailman/venv/lib/python3.8/site-packages/mailman/handlers/subject_prefix.py", line 175, in process
subject = make_header(decode_header(subject))
File "/usr/lib/python3.8/email/header.py", line 174, in make_header
h.append(s, charset)
File "/usr/lib/python3.8/email/header.py", line 295, in append
s = s.decode(input_charset, errors)
UnicodeDecodeError: 'iso2022_jp' codec can't decode bytes in position 0-2: illegal multibyte sequence
May 17 07:39:16 2022 (1708) SHUNTING: 1652773156.3830025+1a96e509d75bcedc64854878b920b30722e16e0b