Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not handing email messages as attachments #151

Open
gwiedeman opened this issue Apr 28, 2022 · 2 comments
Open

Not handing email messages as attachments #151

gwiedeman opened this issue Apr 28, 2022 · 2 comments
Labels
bug Something isn't working Input Parsing input data, such as MBOX, IMAP, PST, EML, etc.

Comments

@gwiedeman
Copy link
Collaborator

Describe the bug
Currently both the MSG and PST parsers barf if messages have other messages as attachments. Not yet sure how the EML and MBOX parsers are handling this. This could be tricky, as theoretically, message attachments could be infinitely recursive, right?

@gwiedeman gwiedeman added the bug Something isn't working label Apr 28, 2022
@gwiedeman gwiedeman added the Input Parsing input data, such as MBOX, IMAP, PST, EML, etc. label Apr 28, 2022
@gwiedeman
Copy link
Collaborator Author

This also causes an error when writing to WARC derivatives, since this module expects a binary when adding attachments to WARC files. The WARC is still created with a body, but the error stops mailbagit from writing additional attachments to the WARC. So if there are 4 attachments, with the third being an attached email, the first two will be written to the WARC, but the 4th will not.

ERROR: No filename found for attachment, integer will be used instead.
**************************************************************************
ERROR: Error adding attachments to WARC derivative: TypeError('quote_from_bytes() expected bytes')
**************************************************************************
Traceback (most recent call last):
  File "c:\users\gw234478\projects\mailbagit\mailbagit\derivatives\warc.py", line 172, in do_task_per_message
    f"{warc_uri}/{quote_plus(attachment.Name)}",
  File "C:\Users\gw234478\AppData\Local\Programs\Python\Python39\lib\urllib\parse.py", line 887, in quote_plus
    string = quote(string, safe + space, encoding, errors)
  File "C:\Users\gw234478\AppData\Local\Programs\Python\Python39\lib\urllib\parse.py", line 871, in quote
    return quote_from_bytes(string, safe)
  File "C:\Users\gw234478\AppData\Local\Programs\Python\Python39\lib\urllib\parse.py", line 896, in quote_from_bytes
    raise TypeError("quote_from_bytes() expected bytes")
TypeError: quote_from_bytes() expected bytes

@gwiedeman
Copy link
Collaborator Author

blocked by #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Input Parsing input data, such as MBOX, IMAP, PST, EML, etc.
Projects
Development

No branches or pull requests

1 participant