Comments (4)
get_payload() returns either a list or string, I thought that in this part of the code only str would be returnable, but it may depend on the mail server and/or the sender mail server.
I tested extensively with Gandi, Zimbra, and Gmail servers ; but I don't have access to other ones.
Without access to the mail or the server provoking the error I will have a hard time debugging.
Could you try to replace attachment_content = part.get_payload().encode("utf-8")
line 488 by something like :
if isinstance(part.get_payload(), list):
attachment_content = part.get_payload(1).encode("utf-8")
else:
attachment_content = part.get_payload().encode("utf-8")
But I'm not sure about using only the first part of the payload in this instance ; it could prevent the handling of multiple attachments.
from imap-attachment-extractor.
You can checkout the develop branch to try this solution.
from imap-attachment-extractor.
Thank you.
I've tried this :
if part.is_multipart():
attachment_content = part.get_payload()
else:
attachment_content = part.get_payload(True)
And it worked pretty well for about 14Gb (on a 20Gb Gmail account). But it fails again somewhere else, and I gave up (sorry).
But nice work here ! It would need a little more debugging, but it's already pretty usefull !
from imap-attachment-extractor.
No problem, thanks for testing anyway !
It's a pain to develop a tool for mail handling as the protocol is implemented differently by almost every servers. So I got it working for the few servers I use, but it may not be ok for others.
from imap-attachment-extractor.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imap-attachment-extractor.