Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

"OSError: [Errno 40] Message too long" #124

Open
jeremymeyers opened this issue Sep 11, 2020 · 3 comments
Open

"OSError: [Errno 40] Message too long" #124

jeremymeyers opened this issue Sep 11, 2020 · 3 comments

Comments

@jeremymeyers
Copy link

using MacOS Catalina, getting this error when trying to convert a MBOX file using the following command

./email2pdf -i splunge.mbox -o splunge.pdf -v --no-attachments --headers --ignore-floating-attachments

Error shown as
"Traceback (most recent call last):
File "/Users/jeremymeyers/.pyenv/versions/3.7.7/lib/python3.7/logging/handlers.py", line 934, in emit
self.socket.send(msg)
OSError: [Errno 40] Message too long

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/jeremymeyers/.pyenv/versions/3.7.7/lib/python3.7/logging/handlers.py", line 938, in emit
self.socket.send(msg)
OSError: [Errno 40] Message too long
Call stack:
File "./email2pdf", line 772, in
call_main(sys.argv, syslog_handler_setup, syserr_handler_setup)
File "./email2pdf", line 732, in call_main
(warning_pending, mostly_hide_warnings) = main(argv, syslog_handler, syserr_handler)
File "./email2pdf", line 109, in main
logger.debug("Email input data is: " + input_data)
Message: " and then a huge string of what appears to be all the emails in the file

I can share the mbox file itself but would rather not post on github for security reasons.

@andrewferrier
Copy link
Owner

@jeremymeyers email2pdf only handles a single message at a time, not a whole mbox file. I think you'll need to split it into individual messages first. Sorry.

@jeremymeyers
Copy link
Author

Ahh gotcha. I misunderstood the function. Some error trapping might be useful for people pushing unsupported filetypes! :)

There don't seem to be any non-commercial MBOX -> PDF converters, if you're looking for a new project.

@andrewferrier
Copy link
Owner

I haven't tried it, but looks like formail -s should do the splitting for you: https://linux.die.net/man/1/formail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants