This one moves all of my new drafts into my inbox every 15 minutes.

I don’t think there is a way to do this without having to check all of the time.

import libgmail
import time
from getpass import getpass

name = raw_input("Gmail account name: ")
pw = getpass()

ga = libgmail.GmailAccount(name, pw)
while 1:
    for thread in ga.getMessagesByFolder("drafts", True):
        if len(thread) == 1: #only apply to new threads
            print, thread.subject
            thread._account._doThreadAction("ib", thread)
    time.sleep(15 * 60)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s