Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [general]
- accounts = Gmail
- maxsyncaccounts = 2
- pythonfile = ~/.offlineimap.py
- [Account Gmail]
- localrepository = LocalGmail
- remoterepository = RepositoryGmail
- autorefresh = 5
- quick = 10
- postsynchook = mu index --maildir ~/Maildir
- status_backend = sqlite
- [Reposiroty LocalGmail]
- type = Maildir
- localfolders = ~/Maildir/Gmail
- [Reposiroty RepositoryGmail]
- type = Gmail
- maxconnections = 2
- remoteuser = myemail@gmail.com
- remotepass = mailpasswd('gmail')
- folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail', '[Gmail]/Important']
- def mailpasswd(acct):
- acct = os.path.basename(acct)
- path = "/PATH/.passwd/%s.gpg" % acct
- args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path]
- try:
- return subprocess.check_output(args).strip()
- except subprocess.CalledProcessError:
- return ""
- def prime_gpg_agent():
- ret = False
- i = 1
- while not ret:
- ret = (mailpasswd("prime") == "prime")
- if i > 2:
- from offlineimap.ui import getglobalui
- sys.stderr.write("Error reading in passwords. Terminating.n")
- getglobalui().terminate()
- i += 1
- return ret
- prime_gpg_agent()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement