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

Add PDF support to save_all_attachments.py #10

Open
EmTee70 opened this issue Nov 29, 2019 · 5 comments
Open

Add PDF support to save_all_attachments.py #10

EmTee70 opened this issue Nov 29, 2019 · 5 comments

Comments

@EmTee70
Copy link

EmTee70 commented Nov 29, 2019

Line 130 results in .xxx if not .txt if I read it right,
I changed it to

if part.get_content_type() == 'text/plain':
    ext = '.txt'
elif part.get_content_type() == 'application/pdf':
    ext = '.pdf'
else:
    ext = '.xxx'

to ensure to get .pdf extension if it is a PDF, I know this is not originally from you, but I just found it here. Thank you.

@szepeviktor
Copy link
Owner

Hello @EmTee70 !

Thank you for your comment.
What file are you referring to?

This repo contains 1 zillion things.

@szepeviktor
Copy link
Owner

szepeviktor commented Nov 29, 2019

@szepeviktor szepeviktor changed the title filename extension .xxx Add PDF support to save_all_attachments.py Nov 29, 2019
@EmTee70
Copy link
Author

EmTee70 commented Nov 29, 2019

Yes, you are right. I am relative new to GitHub and so I was calling it an issue, it would probably be cool to support all mime types. Put them in an associative array and so... maybe I try to solve this.

@szepeviktor
Copy link
Owner

szepeviktor commented Nov 29, 2019

No problem!

Just press the pencil icon (top right)
https://github.com/szepeviktor/debian-server-tools/blob/master/mail/extract-attachments/save_all_attachments.py
and send your idea in a Pull Request!

@szepeviktor
Copy link
Owner

@EmTee70 Is it okay for me if you write your suggestion here as a snippet.

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