offlineimap
offlineimap copied to clipboard
Script in cert_fingerprint
Hi,
Outlook regulary changes their certificate. I added a method to the pythonfile. Is there a way to call it like this:
[general]
accounts = Outlook
pythonfile = ~/.offlineimap.py
and somewhere else
cert_fingerprint = get_cert("imap-mail.outlook.com", 993)
I think you should use the presynchook configuration option.
I looked into it,
should I inject/write the certificate fingerprint into the .offlinemaprc with a script or can I still have somehting like cert_fingerprint = ...?
My bad. I didn't read your post carefully and the presynchook won't help at all.
There's no way to dynamically get the fingerprint. So yes, injecting the correct fingerprint to the configuration file is one possible way to go. That sucks...
I stumbled upon this issue as well. My "solution" is to wrap the executable and have the wrapper set cert_fingerprint on the command line with -k. Would be cool to have cert_fingerprinteval though.
It could also be feasible to replace offlineimap with your own python script which then uses it a library? I might look into doing that.
As a side remark, it feels like the configuration file syntax does not scale well in this regard and should be reworked. generally you probably want to be able to set most options via either:
- and explicit in place value
- reading it from a file
- evaluating a python expression