Backup GMAIL Messages with Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gregory Piñero

    #1

    Backup GMAIL Messages with Python

    I was wondering what methods you experts would reccomend for this task?

    Here are the options I have come up with so far:

    1. Build something with the poblib library
    (http://docs.python.org/lib/module-poplib.html)
    --Any pointers on doing this? How to I get poplib to save messages in
    a standard format I can
    later import into Thunderbird, Outlook, etc? (mbox?)

    2. Use libgmail
    --How stable is this package? Does it just use screenscraping?

    3. Call Fetchmail from command line?
    --Does anyone know an easy way to do this? All I found was a 6 page
    tutorial! yikes!

    Much thanks for any advice you might have. I'm also open to options I
    haven't thought of too.

    --
    Gregory Piñero
    Chief Innovation Officer
    Blended Technologies
    (www.blendedtechnologies.com)
  • Simon Forman

    #2
    Re: Backup GMAIL Messages with Python

    Gregory Piñero wrote:
    I was wondering what methods you experts would reccomend for this task?
    >
    Here are the options I have come up with so far:
    >
    1. Build something with the poblib library
    (http://docs.python.org/lib/module-poplib.html)
    --Any pointers on doing this? How to I get poplib to save messages in
    a standard format I can
    later import into Thunderbird, Outlook, etc? (mbox?)
    I don't do much with email, but there's an example of accessing gmail
    via poplib here:


    And of course there's the 'email' standard library module:
    Source code: Lib/email/__init__.py The email package is a library for managing email messages. It is specifically not designed to do any sending of email messages to SMTP ( RFC 2821), NNTP, or othe...


    HTH,
    ~Simon

    Out of curiosity, why do you want to _backup_ a gmail account? (I use
    my gmail account to backup files and documents I never want to lose.)
    I could think of some reasons, but I'm wondering what yours are. : )

    Comment

    • Gregory Piñero

      #3
      Re: Backup GMAIL Messages with Python

      On 5 Aug 2006 15:27:03 -0700, Simon Forman <rogue_pedro@ya hoo.comwrote:
      Out of curiosity, why do you want to _backup_ a gmail account? (I use
      my gmail account to backup files and documents I never want to lose.)
      I could think of some reasons, but I'm wondering what yours are. : )
      Here are a few:

      1. Google could turn evil someday (and delete everyones' data?)
      2. Google coud lose or delete data by accident
      3. You could lose your internet connection for an extended period of time
      4. You may want to move to a different email software in the future
      and am not able to export from Google calendar at that time(see reason
      1)

      Update on my question:
      getmail looks like another option: http://pyropus.ca/software/getmail/
      but not cross platform?

      -Greg

      Comment

      • Neil Hodgson

        #4
        Re: Backup GMAIL Messages with Python

        Gregory Piñero:
        I was wondering what methods you experts
        would reccomend for this task?
        While you can write a script, its quite easy to turn on POP and run
        a client side mail client like Thunderbird.

        Neil

        Comment

        • Gregory Piñero

          #5
          Re: Backup GMAIL Messages with Python

          On 8/5/06, Neil Hodgson <nyamatongwe+th under@gmail.com wrote:
          While you can write a script, its quite easy to turn on POP and run
          a client side mail client like Thunderbird.
          Good point, Neil. This is a very tempting option, I just wanted to
          include it in a backup script rather than having to open up
          Thunderbird once a day.

          -Greg

          Comment

          • Chris Lambacher

            #6
            Re: Backup GMAIL Messages with Python

            fetchmail worked for me. You have to be patient though because it takes a
            while for all of your mail to become available for pop download.

            -Chris
            On Sat, Aug 05, 2006 at 08:43:32PM -0400, Gregory Pi?ero wrote:
            On 8/5/06, Neil Hodgson <nyamatongwe+th under@gmail.com wrote:
            While you can write a script, its quite easy to turn on POP and run
            a client side mail client like Thunderbird.
            >
            Good point, Neil. This is a very tempting option, I just wanted to
            include it in a backup script rather than having to open up
            Thunderbird once a day.
            >
            -Greg
            --
            http://mail.python.org/mailman/listinfo/python-list

            Comment

            Working...