danamir / imap-attachment-extractor Goto Github PK
View Code? Open in Web Editor NEWIMAP attachment exporter, with optional Thunderbird detach mode
IMAP attachment exporter, with optional Thunderbird detach mode
Hi (great tool - thanks for providing it!!!)
I tried with a smaller mailbox first: no issues. Second test was with a mailbox with >65656 messages in INBOX.
macOS Intel - recent version - Py 3.10 (brew)
I see this result:
(.env) tschloss@Mac-mini imap-attachment-extractor % imap_aex --password -d "2022-08-07"
Password:
[Dry-run] Create extract dir /Users/tschloss/Programming/imap-attachment-extractor/INBOX.
Selected folder 'INBOX' (64556 mails).
45 messages corresponding to search.
1 messages with attachments.
Parsing mail: 'cronjob p487261 Update mvonline' [2022-08-07 05:40:06]
Attachment 'p487261_Update mvonline.log' size (129.0B) is smaller than defined threshold (100.0KB), leave intact.
Nothing extracted.
Traceback (most recent call last):
File "/Users/tschloss/Programming/imap-attachment-extractor/.env/bin/imap_aex", line 33, in <module>
sys.exit(load_entry_point('imap-attachment-extractor', 'console_scripts', 'imap_aex')())
File "/Users/tschloss/Programming/imap-attachment-extractor/imap_aex.py", line 860, in cli
main(options, defaults)
File "/Users/tschloss/Programming/imap-attachment-extractor/imap_aex.py", line 852, in main
imap.extract(**extract_kwargs)
File "/Users/tschloss/Programming/imap-attachment-extractor/imap_aex.py", line 422, in extract
mail = message_from_bytes(fetch[1]) # type: EmailMessage
File "/usr/local/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/__init__.py", line 46, in message_from_bytes
return BytesParser(*args, **kws).parsebytes(s)
File "/usr/local/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/email/parser.py", line 122, in parsebytes
text = text.decode('ASCII', errors='surrogateescape')
AttributeError: 'int' object has no attribute 'decode'
Any ideas? Something wrong on my side?
Thank you
Thomas
Extracted 3 attachments, replacing email.
Append message on IMAP server.
Delete original message.
Traceback (most recent call last):
File "/home/pengu/aurore/imap-attachment-extractor/.env/bin/imap_aex", line 11, in
load_entry_point('imap-attachment-extractor', 'console_scripts', 'imap_aex')()
File "/home/pengu/aurore/imap-attachment-extractor/imap_aex.py", line 824, in cli
main(options, defaults)
File "/home/pengu/aurore/imap-attachment-extractor/imap_aex.py", line 816, in main
imap.extract(**extract_kwargs)
File "/home/pengu/aurore/imap-attachment-extractor/imap_aex.py", line 493, in extract
attachment_content = part.get_payload().encode("utf-8")
AttributeError: 'list' object has no attribute 'encode'
Hi, I get this error:
"Selected folder 'INBOX' (10 mails).
Warning: Could not search in INBOX"
What went wrong?
Thanks in advance.
cu
F. :-)
Hi, I have a second issue:
After altering a message with the tool, Apple Mail (macOS) shows the message with the current time, not the original timestamp.
Same problem with the webmail frontend of the provider Strato.
Mailmate does not show this wrong date.
When inspecting the source of the mail in the webmail frontend I could NOT find any time field which is altered. So I am not sure if somebody stores metadata besides the source text of a message?
I do not have this behavior when I remove attachments with Mailmate or Apple Mail. Not sure if these applications have another mechanism than "delete & append"?
Any ideas?
Thomas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.