Add PDF support to save_all_attachments.py
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.
Hello @EmTee70 !
Thank you for your comment. What file are you referring to?
This repo contains 1 zillion things.
https://github.com/szepeviktor/debian-server-tools/blob/master/mail/extract-attachments/save_all_attachments.py#L130 ??
This code is copied from http://janeelix.com/piers/python/save_all_attachments
Feel free to send a PR!
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.
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!
@EmTee70 Is it okay for me if you write your suggestion here as a snippet.