Decoding MIME email.

Discussion in 'Python' started by Thomas Williams, Aug 25, 2003.

  1. 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
    Thomas Williams, Aug 25, 2003
    #1
    1. Advertising

  2. 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
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Sybren Stuvel, Aug 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr

    decoding MIME attachments?

    Mad Scientist Jr, Nov 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    653
    Bruce Barker
    Nov 11, 2005
  2. =?ISO-8859-1?Q?Gerhard_H=E4ring?=

    Re: Decoding MIME email.

    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Aug 26, 2003, in forum: Python
    Replies:
    0
    Views:
    381
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Aug 26, 2003
  3. Thomas Williams

    Decoding MIME email

    Thomas Williams, Aug 26, 2003, in forum: Python
    Replies:
    1
    Views:
    499
    Tim Roberts
    Aug 28, 2003
  4. cayenne
    Replies:
    3
    Views:
    246
    Brian McCauley
    May 26, 2004
  5. ecureuil
    Replies:
    0
    Views:
    320
    ecureuil
    May 28, 2006
Loading...

Share This Page