mailbagit
mailbagit copied to clipboard
Header error writing EML derivatives
Describe the bug Got his for a minority of messages writing to EML. I believe it was from a PST source. Should be a common header key so it needs to be looked at more. Might need to normalize the encoding strings that are coming out of PSTs now per #150.
Traceback (most recent call last):
File "F:\Projects\mailbag\mailbag\derivatives\eml.py", line 119, in do_task_per_message
gen.flatten(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 116, in flatten
self._write(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 181, in _write
self._dispatch(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 214, in _dispatch
meth(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 272, in _handle_multipart
g.flatten(part, unixfrom=False, linesep=self._NL)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 116, in flatten
self._write(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 181, in _write
self._dispatch(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 214, in _dispatch
meth(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 272, in _handle_multipart
g.flatten(part, unixfrom=False, linesep=self._NL)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 116, in flatten
self._write(msg)
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\generator.py", line 189, in _write
msg.replace_header('content-transfer-encoding', munge_cte[0])
File "c:\users\greg\appdata\local\programs\python\python37-32\lib\email\message.py", line 558, in replace_header
raise KeyError(_name)
KeyError: 'content-transfer-encoding'
Haven't been able to recreate this unfortunately. Not sure if it got fixed or if I didn't document it right.
Confirmed by a user that this issue is still present, but I can't recreate it with our sample data, so I guess its going in the MVP release. ¯_(ツ)_/¯