Decoding MIME email.

T

Thomas Williams

Hello everyone, my name is Tom W. And, I am new to the
list, and have been using Python for about a year now.


Anyway, I got a question! I am trying to decode MIME
(base64) email from a POP3 server, but all I get is a
corrupt file. I know that it good to begin with
because I check it with another email client.

This is what I am doing!

......

f=open("msg.txt","wb")
f.write(filelne)
f.close()
mimify.unmimify("msg.txt", "msg.jpg",
decode_base64=1)

.........

Is this right?

Tom W
 
S

Sybren Stuvel

Thomas Williams enlightened us with:
I am trying to decode MIME (base64) email from a POP3 server

You are seriously messing things up. Base64 is something quite
different from MIME. If you want to do Base64 decoding, skip the POP3
and email stuff, and concentrate on the decoding first. It's better to
split your problem into smaller parts.
all I get is a corrupt file. I know that it good to begin with
because I check it with another email client.

Again: skip the email stuff. Create a base64 encoded file with
"uuencode -m filename < filename" and try to decode that.
This is what I am doing!

.....

f=open("msg.txt","wb")
f.write(filelne)
f.close()
mimify.unmimify("msg.txt", "msg.jpg",
decode_base64=1)

........

Is this right?

You show us everything except the actual base64 decoding stuff. Oh,
and you can't be doing things right, since you get messed up files.

Sybren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,369
Latest member
Carmen32T6

Latest Threads

Top