Emails backup in python 3.2

Discussion in 'Python' started by TheSaint, Jun 21, 2011.

  1. TheSaint

    TheSaint Guest

    Hello,
    I'm looking for an idea how to backup emails retrieved by poplib and save
    them into mailbox.mbox file.
    The problem is the received message which is a list of bytes streams,
    mailbox.mbox don't expect a list.
    What conversion should I do?
    A file type io.StringIO ?
    decoding every bytes stream which might not have any declared codec?

    As far as python moved into unicode, why doesn't it handle these undecoded
    bytes as it was with strings before?

    --
    goto /dev/null
     
    TheSaint, Jun 21, 2011
    #1
    1. Advertising

  2. Why not use one of the many projects and products that are designed to
    store email? Do you have a special reason for wanting to implement
    your own email storage?

    I'm thinking that you can use fetchmail with your favorite mail store,
    and you won't need to write any code at all.

    http://fetchmail.berlios.de/

    Michael

    On Tue, Jun 21, 2011 at 9:03 AM, TheSaint <> wrote:
    > Hello,
    > I'm looking for an idea how to backup emails retrieved by poplib and save
    > them into mailbox.mbox file.
    > The problem is the received message which is a list of bytes streams,
    > mailbox.mbox don't expect a list.
    > What conversion should I do?
    > A file type io.StringIO ?
    > decoding every bytes stream which might not have any declared codec?
    >
    > As far as python moved into unicode, why doesn't it handle these undecoded
    > bytes as it was with strings before?
    >
    > --
    > goto /dev/null
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
     
    Michael Hrivnak, Jun 22, 2011
    #2
    1. Advertising

  3. TheSaint

    TheSaint Guest

    Michael Hrivnak wrote:

    > Do you have a special reason for wanting to implement
    > your own email storage?


    Learning python :)

    It seems very easy to get my mails with the poplib help.
    Usually I work with Kmail which imports mbox files.
    I'm not prone to set up a SMTP server on my PC.

    --
    goto /dev/null
     
    TheSaint, Jun 22, 2011
    #3
    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. Tim Gahnstrom

    rdff-backup / python linux fat32

    Tim Gahnstrom, Jun 24, 2004, in forum: Python
    Replies:
    3
    Views:
    451
    Eric Belanger
    Jun 24, 2004
  2. gavino
    Replies:
    13
    Views:
    1,044
  3. =?ISO-8859-1?Q?Gregory_Pi=F1ero?=

    Backup GMAIL Messages with Python

    =?ISO-8859-1?Q?Gregory_Pi=F1ero?=, Aug 5, 2006, in forum: Python
    Replies:
    6
    Views:
    3,887
    Chris Lambacher
    Aug 8, 2006
  4. Ryan Krauss

    iso creation for python backup script

    Ryan Krauss, Sep 7, 2006, in forum: Python
    Replies:
    1
    Views:
    582
    Yu-Xi Lim
    Sep 7, 2006
  5. Replies:
    0
    Views:
    581
Loading...

Share This Page