interpolating account names

Mathias Korber mathias at koerber.org
Sat Jan 20 08:04:25 GMT 2018


I am trying to set up offlineimap (7.1.5) for severa;gmail accounts.

I was hoping to use

[general]
# Path to file with arbitrary Python code to be loaded
pythonfile = ~/.offlineimap/offlineimap.py

#[default]
remotepasseval = get_pass(%(account))


(with the pass tool to look up the password)

but with that, OI always asks for the password.


So I am not sure what variable I should interpolate
(I tried account and accountname)

I also tried adding some debug code to the python function
in ~/.offlineimap/offlineimap.py

#! /usr/bin/env python2
from subprocess import check_output

def get_pass(account):
    f=open("/Users/mathias/.offlineimap/python_debug","a")
    f.write("acocunt name = %s"%account)
    f.close
    return check_output("pass Mail/" + account,
                shell=True).splitlines()[0]


But that does not even result in the file being opened.


So this raises two (3?) questions:

a) which variable should I use to pass the account name
in the [default]  section  (so I don't have to specify
a separate one in each account

b) is there a list of all variable/fields that I can interpolate

c) how to add debugging into the python script?





More information about the OfflineIMAP-project mailing list