Variable or expression for sslcacertfile?

John Mastro john.b.mastro at
Mon Nov 17 02:18:56 GMT 2014


I'd like to use offlineimap on two different systems, hopefully with an
identical configuration file. So far this is working well, except for
the `sslcacertfile` option.

I've tried two different approaches. First, I put a variable in my
`pythonfile`, like so:

    # ~/
    if is_one_system():
        certfile = '/one/path/to/certs.pem'
        certfile = '/different/path/to/certs.pem'

Then in my `.offlineimaprc` I put `sslcacertfile = certfile`.

However, that didn't work - it just looked for a file `~/certfile`.

Next, I tried using a Python expression in the actual configuration
field, like this:

    # ~/.offlineimaprc
    sslcacertfile = '/one/path/to/certs.pem' if is_one_system() else

I was hoping that Python expressions could be used in any of the fields,
but that doesn't seem to be the case. It interpreted the field literally
and looked for a file with that name.

Is there any other way I can arrange for this? I know the obvious
answer is to have separate configuration files for the two systems, but
I'm trying to avoid that.

Another option I've considered is to use a symlink to the cert file,
but maybe there are security implications (genuinely unsure).



More information about the OfflineIMAP-project mailing list