Skip to content

UnicodeEncodeError: 'ascii' codec can't encode character #2

@CipherGuardianSweden

Description

@CipherGuardianSweden
[config.yaml] 2022-04-19 23:39:12:ERROR:Exception raised during forward()
Traceback (most recent call last):
  File "imap2imap.py", line 85, in run
    dest_imap_config=self.config['dest_imap']
  File "imap2imap.py", line 184, in forward
    mailbox=dest_imap_config.get("mailbox", "INBOX")
  File "imap2imap.py", line 354, in upload_message
    message=msg.as_bytes()
  File "C:\Python34\lib\email\message.py", line 178, in as_bytes
    g.flatten(self, unixfrom=unixfrom)
  File "C:\Python34\lib\email\generator.py", line 116, in flatten
    self._write(msg)
  File "C:\Python34\lib\email\generator.py", line 181, in _write
    self._dispatch(msg)
  File "C:\Python34\lib\email\generator.py", line 214, in _dispatch
    meth(msg)
  File "C:\Python34\lib\email\generator.py", line 264, in _handle_multipart
    self.write(subparts)
  File "C:\Python34\lib\email\generator.py", line 406, in write
    self._fp.write(s.encode('ascii', 'surrogateescape'))
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 26: ordinal not in range(128)

I got also the same mail over and over on the host side. Any solution to this? Otherwise a good script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions