summaryrefslogtreecommitdiffstats
path: root/offlineimap
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-09-22 22:56:54 +0200
committerGravatar Tom Willemse2014-09-22 23:04:10 +0200
commit931979b5c6ac0d16ee46365a1d770274ba9e03f0 (patch)
tree45f5eb374670c1cb39130c544768131375c7a363 /offlineimap
parent9ccb99ee15f087a30eb746adb48984b49d5a6d79 (diff)
downloaddotfiles-931979b5c6ac0d16ee46365a1d770274ba9e03f0.tar.gz
dotfiles-931979b5c6ac0d16ee46365a1d770274ba9e03f0.zip
Use a keyring to store some credentials
Diffstat (limited to 'offlineimap')
-rw-r--r--offlineimap/.offlineimap.py11
-rw-r--r--offlineimap/.offlineimaprc8
2 files changed, 6 insertions, 13 deletions
diff --git a/offlineimap/.offlineimap.py b/offlineimap/.offlineimap.py
index fb4f66e..9ae081e 100644
--- a/offlineimap/.offlineimap.py
+++ b/offlineimap/.offlineimap.py
@@ -1,4 +1,5 @@
from offlineimap import imaputil
+import keyring
def lld_flagsimap2maildir(flagstring):
@@ -39,13 +40,5 @@ imaputil.flagsmaildir2imap = lld_flagsmaildir2imap
imaputil.flagsimap2maildir = lld_flagsimap2maildir
-def getuser(host):
- import netrc
- mynet = netrc.netrc()
- return mynet.authenticators(host)[0]
-
-
def getpassword(host):
- import netrc
- mynet = netrc.netrc()
- return mynet.authenticators(host)[2]
+ return keyring.get_password('offlineimap', host)
diff --git a/offlineimap/.offlineimaprc b/offlineimap/.offlineimaprc
index af59f59..07a2893 100644
--- a/offlineimap/.offlineimaprc
+++ b/offlineimap/.offlineimaprc
@@ -18,8 +18,8 @@ nametrans = lambda folder: re.sub('^Inbox$', 'INBOX', folder.capitalize())
[Repository ryuslash.org-remote]
type = IMAP
remotehost = imap.alwaysdata.com
-remoteusereval = getuser("imap.alwaysdata.com")
-remotepasseval = getpassword("imap.alwaysdata.com")
+remoteuser = 'tom@ryuslash.org'
+remotepasseval = getpassword("ryuslash")
nametrans = lambda folder: folder.lower()
[Account picturefix]
@@ -71,8 +71,8 @@ nametrans = lambda folder: re.sub('^inbox$', 'INBOX', re.sub('^drafts$', '[Gm
[Repository gmail-remote]
type = Gmail
-remoteusereval = getuser("imap.google.com")
-remotepasseval = getpassword("imap.google.com")
+remoteuser = "ryuslash@gmail.com"
+remotepasseval = getpassword("gmail")
realdelete = no
cert_fingerprint = 687687a7f2dc166baf58221ff7a42f1683d0d164
folderfilter = lambda folder: folder in ['INBOX', '[Gmail]/Drafts', '[Gmail]/Sent Mail', '[Gmail]/Trash']