offlineimap icon indicating copy to clipboard operation
offlineimap copied to clipboard

Script in cert_fingerprint

Open der-daniel opened this issue 8 years ago • 4 comments

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)

der-daniel avatar Sep 11 '17 19:09 der-daniel

I think you should use the presynchook configuration option.

nicolas33 avatar Sep 11 '17 22:09 nicolas33

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 = ...?

der-daniel avatar Sep 13 '17 20:09 der-daniel

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...

nicolas33 avatar Sep 13 '17 22:09 nicolas33

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

xaverdh avatar Jul 09 '19 22:07 xaverdh