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

Attachments corrupted #5

Closed
BusinessTec opened this issue Jun 11, 2015 · 9 comments
Closed

Attachments corrupted #5

BusinessTec opened this issue Jun 11, 2015 · 9 comments

Comments

@BusinessTec
Copy link

Following my tests on 'from' issue, I added attachments to the mail message using contents. I realized that almost all of them are coming corrupted (xslx, docx, pdf, zip -after changing extension to pass smtp security).
I believe I tested this option with older version a few days ago - but I am not sure about file formats used at that time.
Using the latest version of yagmail from 10/6/2015.

@kootenpv
Copy link
Owner

Indeed, it requires the file extension so you do not have to specify the mimetype yourself. I'm able to send them though, no security issues... what is the configuration to reproduce the issue on your end?

@BusinessTec
Copy link
Author

The note on changing extension was only related to zip file (it was blocked on smtp with zip extension). The others are being send OK but files are delivered corrupted.
I can be easily reproduced by sending .docx, xlsx, pdf files. They worked fine before sending, but while opening received ones an error is reported.

@BusinessTec
Copy link
Author

I compared files before and after sending as attachments, got from an example following output:
i.xlsx ii.xlsx differ: byte 103, line 1 is 130 X 12 ^J
from
cmp -b i.xlsx ii.xlsx

Runing a full list of differences produces a list of all bytes in the file.

@kootenpv
Copy link
Owner

Confirmed, it was a bug. Hopefully now I got the encodings right in all cases. Please upgrade (pip install -U yagmail, to version 0.3.79) and try again.

Thanks a lot for filing the issue!

@BusinessTec
Copy link
Author

It looks like nothing is attached at all. I can see the name of the file only. In case of .png file I see the name of the file plus place holder for the image in the email body, but no image at all.

Just in case, I am testing with python 2.7, Ubuntu 15.04.

Thanks a lot for your effort!

@kootenpv
Copy link
Owner

Confirmed, I only tested with Python 3 since the latest bug was there (though now it works for 3). Now looking at a way to solve for Python 2.

@kootenpv
Copy link
Owner

Fixed for both Python 2 & 3. Tested files with .py, .jpg and .xlsx extension. Please confirm once more (version 0.3.81)!

@BusinessTec
Copy link
Author

It works great now - I tested with few other extensions with no problems.
Congratulation on really useful project!

@kootenpv
Copy link
Owner

Thank you very much!

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

No branches or pull requests

2 participants