Fixing a simple python script

I use a simple python script, which receives an inconing email via stdin and extracts all attachments. It then calculates the md5 value of them and hands them over to an online virus scanner.

You can see the code at

[url removed, login to view]

It's only 1 file with about 100 lines of code.

However, the current version is broken: Some attachments are not extracted correctly and as far as I can see it has to do with multipart emails.

I'm not a python developer, so I need someone who can fix the script.

Currently, the problematic point looks like this:


for part in [url removed, login to view]() : # iterate through all the MIME-parts

pl = part.get_payload(decode=True) # get the "body" of the MIME-part

if isinstance(pl, str) : # is there a real payload?


This seems to not catch all attachments.

If you agree then you need to fix the script and I need to check if it works and that's it. :-)

Skills: Python

See more: python pl, far part 27, code python online, write simple script python, python script create simple mysql database, script php simple addition pages, script python badoo, php script python, script python html, python simple browser, script python extract html tags, login script php simple, python simple web browser

About the Employer:
( 97 reviews ) Delmenhorst, Germany

Project ID: #9486193

Awarded to:


Hello! I have expirience working with email in Python, I worked in project that parses emails and hands them over to other services. It would be really great if you could provide examples of emails, where attachments More

$32 USD in 1 day
(1 Review)

7 freelancers are bidding on average $31 for this job


Hi, I am an expert Python Developer and can help you to fix issues in your python script. Please, have a look at my profile. Regards, Anurag Koul

$50 USD in 1 day
(8 Reviews)

Hello, I have done a few python programs. Can start working on your task immediately. If you give some samples, it would be great.

$30 USD in 1 day
(14 Reviews)

Hello, i'll be glad to fix the problem for you . As you can see in my profile , i have an experience with python programming . please refer to my previous projects feedbacks to have an idea about my work quality. l More

$40 USD in 1 day
(1 Review)

A proposal has not yet been provided

$45 USD in 1 day
(0 Reviews)

I know python. I can fix the script. So, if I understand correctly, you want to compute the checksum of the whole of the email and not the parts. Right? [login to view URL] iterates over the parts of the message.

$30 USD in 1 day
(0 Reviews)

<<<< i can help you low budget PLEASE CHAT ME >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ___________________________________________________________________________________________________________________

$10 USD in 1 day
(0 Reviews)

Hello I'm a python developer. I have been developed python/Django/Flask web sites for 5 years. And I have rich experience in python webscraping and web API(SOAP, RESTful apis) And I have high studying skill and mos More

$32 USD in 1 day
(0 Reviews)