Package: getmail
Version: 5.13-1
Severity: normal
Tags: buster
X-Debbugs-CC: getm...@lists.pyropus.ca
X-Debbugs-CC: charlesc-getmail-supp...@pyropus.ca

I now have to soothe a lot of angry people because I didn't receive
some important mails from one of my accounts (and thus didn't act
correctly). The problem was that I received a mail with following
(raw) Cc line on the same account:

Cc:     =?utf-8?b?UmFmYcWCIE1pxYJl?==?utf-8?b?Y2tp?= <ra...@milecki.pl>

It seems like python2 can decode this:

>>> email.header.decode_header('=?utf-8?b?UmFmYcWCIE1pxYJl?= =?utf-8?b?Y2tp?=')

but not

>>> email.header.decode_header('=?utf-8?b?UmFmYcWCIE1pxYJl?==?utf-8?b?Y2tp?=')
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/lib/python2.7/email/header.py", line 108, in decode_header
   raise HeaderParseError
email.errors.HeaderParseError

getmail just crashed all the time (and systemd restarted it
automatically) but never downloaded any mail for this specific account
again.

getmail[15939]: Traceback (most recent call last):
getmail[15939]:   File "/usr/bin/getmail", line 934, in <module>
getmail[15939]:     main()
getmail[15939]:   File "/usr/bin/getmail", line 898, in main
getmail[15939]:     success = go(configs, options.idle)
getmail[15939]:   File "/usr/bin/getmail", line 200, in go
getmail[15939]:     msg = retriever.getmsg(msgid)
getmail[15939]:   File
"/usr/lib/python2.7/dist-packages/getmailcore/_retrieverbases.py",
line 1008, in getmsg
getmail[15939]:     return self._getmsgbyid(msgid)
getmail[15939]:   File
"/usr/lib/python2.7/dist-packages/getmailcore/_retrieverbases.py",
line 1934, in _getmsgbyid
getmail[15939]:     for (val, encoding) in decode_header(encoded_value):
getmail[15939]:   File "/usr/lib/python2.7/email/header.py", line 108,
in decode_header
getmail[15939]:     raise HeaderParseError
getmail[15939]: email.errors.HeaderParseError
systemd[261]: getmail.service: Main process exited, code=exited,
status=1/FAILURE
systemd[261]: getmail.service: Failed with result 'exit-code'.

This will no longer affect getmail in Debian sid in the near future
because sid is dropping Python2 (and Python3 doesn't have this
decoding problem).

Reply via email to