mailbagit icon indicating copy to clipboard operation
mailbagit copied to clipboard

Header error writing EML derivatives

Open gwiedeman opened this issue 2 years ago • 2 comments

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'

gwiedeman avatar Apr 29 '22 16:04 gwiedeman