Error copying emails to folder
After the logging cleanup in #8849 (closed), I have successfully moved some emails, but with latest bundle, I ran into the following:
2017-05-13T11:06:35+0200 [leap.bitmask.mail.imap.service.LocalSoledadIMAPServer#debug] rcv (select): DONE
2017-05-13T11:06:35+0200 [leap.bitmask.mail.imap.service.LocalSoledadIMAPServer#debug] Unable to format event {'log_namespace': 'leap.bitmask.mail.imap.service.LocalSoledadIMAPServer', 'log_level': <LogLevel=debug>, 'log_logger': <Logger 'leap.bitmask.mail.imap.service.LocalSoledadIMAPServer'>, 'log_time': 1494666395.58233, 'log_source': <leap.bitmask.mail.imap.service.LocalSoledadIMAPServer instance at 0x7feb6ee09950>, 'log_format': 'rcv (select): 16 append "INBOX/BLFS Hints/2005/2005Q4" (\\Seen) "02-Oct-2005 16:44:53 +0200" {4973+}'}: u'4973+'
2017-05-13T11:06:35+0200 [leap.bitmask.mail.imap.service.LocalSoledadIMAPServer#debug] rcv (select):
2017-05-13T11:06:35+0200 [leap.bitmask.mail.adaptors.soledad.HeaderDocWrapper#debug] Got conflict while putting H-24E439C5573253993C98468F304A25386718B7D5DBA0465E8B7DF2C56C639FFB
2017-05-13T11:06:35+0200 [leap.bitmask.mail.adaptors.soledad.FlagsDocWrapper#debug] Got conflict while putting F-bf05dbf2_581d_48ed_847a_a3450636550a-24E439C5573253993C98468F304A25386718B7D5DBA0465E8B7DF2C56C639FFB
2017-05-13T11:06:35+0200 [leap.bitmask.mail.adaptors.soledad.MetaMsgDocWrapper#debug] Got conflict while putting M-bf05dbf2_581d_48ed_847a_a3450636550a-24E439C5573253993C98468F304A25386718B7D5DBA0465E8B7DF2C56C639FFB
2017-05-13T11:06:35+0200 [leap.bitmask.mail.mail.MessageCollection#error] Unable to format event {'log_namespace': 'leap.bitmask.mail.mail.MessageCollection', 'log_level': <LogLevel=error>, 'log_logger': <Logger 'leap.bitmask.mail.mail.MessageCollection'>, 'log_time': 1494666395.604982, 'log_source': <leap.bitmask.mail.mail.MessageCollection object at 0x7feb6c07f810>, 'log_format': "BUG: (please report) Null doc_id for document {'fdoc': 'F-bf05dbf2_581d_48ed_847a_a3450636550a-24E439C5573253993C98468F304A25386718B7D5DBA0465E8B7DF2C56C639FFB', 'type': 'meta', 'hdoc': 'H-24E439C5573253993C98468F304A25386718B7D5DBA0465E8B7DF2C56C639FFB', 'cdocs': ['C-F63BEE211836FE8C7E87004B860FCE345E7EB8C96A9C2FD7554478034FF7DD41', 'C-54F9F9B7F0612D0D5BDB1A862B6BAB67D857D23524CD607FFEC49A261431391E']}"}: u"'fdoc'"
2017-05-13T11:06:35+0200 [leap.bitmask.mail.mail.MessageCollection#error] Error adding msg!
2017-05-13T11:06:35+0200 [leap.bitmask.mail.adaptors.soledad.ContentDocWrapper#debug] Got conflict while putting C-F63BEE211836FE8C7E87004B860FCE345E7EB8C96A9C2FD7554478034FF7DD41
2017-05-13T11:06:35+0200 [leap.bitmask.mail.adaptors.soledad.ContentDocWrapper#debug] Got conflict while putting C-54F9F9B7F0612D0D5BDB1A862B6BAB67D857D23524CD607FFEC49A261431391E
2017-05-13T11:06:35+0200 [leap.bitmask.mail.adaptors.soledad.MessageWrapper#debug] All parts inserted for msg!
2017-05-13T11:06:35+0200 [leap.bitmask.mail.imap.service.LocalSoledadIMAPServer#debug] Unable to format event {'log_namespace': 'leap.bitmask.mail.imap.service.LocalSoledadIMAPServer', 'log_level': <LogLevel=debug>, 'log_logger': <Logger 'leap.bitmask.mail.imap.service.LocalSoledadIMAPServer'>, 'log_time': 1494666395.61418, 'log_source': <leap.bitmask.mail.imap.service.LocalSoledadIMAPServer instance at 0x7feb6ee09950>, 'log_format': 'rcv (select): 17 append "INBOX/BLFS Hints/2005/2005Q4" (\\Seen) {4740+}'}: u'4740+'
2017-05-13T11:06:35+0200 [leap.bitmask.mail.imap.service.LocalSoledadIMAPServer#debug] rcv (select):
2017-05-13T11:06:35+0200 [leap.bitmask.mail.imap.service.LocalSoledadIMAPServer#critical] Error appending
Traceback (most recent call last):
File "site-packages/twisted/internet/base.py", line 1252, in mainLoop
File "site-packages/twisted/internet/base.py", line 851, in runUntilCurrent
File "site-packages/twisted/internet/defer.py", line 459, in callback
File "site-packages/twisted/internet/defer.py", line 567, in _startRunCallbacks
--- <exception caught here> ---
File "site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
File "site-packages/leap/bitmask/mail/imap/server.py", line 599, in _cbAppendGotMailbox
File "site-packages/leap/bitmask/mail/imap/mailbox.py", line 384, in addMessage
File "site-packages/leap/bitmask/mail/mail.py", line 616, in add_msg
File "site-packages/leap/bitmask/mail/adaptors/soledad.py", line 876, in get_msg_from_string
File "site-packages/leap/bitmask/mail/adaptors/soledad.py", line 1192, in _split_into_parts
File "email/message.py", line 137, in as_string
File "email/generator.py", line 83, in flatten
File "email/generator.py", line 115, in _write
File "email/generator.py", line 164, in _write_headers
File "email/header.py", line 183, in __init__
File "email/header.py", line 272, in append
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 8: ordinal not in range(128)