Open berghaus opened 2 years ago
Workaround: run in pyton2 with openssl 1.1:
OfflineIMAP 7.3.4 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v2.101 (bundled), Python v2.7.18, OpenSSL 1.1.1d 10 Sep 2019
I did this by using a container, which I built like so:
FROM python:2-alpine
RUN apk add openssl & pip install offlineimap==7.3.4
ENTRYPOINT ["offlineimap"]
and run like so
function offlineimap {
if [[ -z "${XDG_CONFIG_HOME}" ]]; then
CONFIG="${HOME}/"
else
CONFIG="${XDG_CONFIG_HOME}/offlineimap/config"
fi
docker run \
--user "${UID}:${GID}" \
--mount type=bind,source="${CONFIG}",target="/.offlineimaprc" \
--volume "${HOME}/Mail":"/Mail" \
--volume "${HOME}/.offlineimap":"/.offlineimap" \
--rm -it \
offlineimap "$@"
}
Where my local accounts end up in ~/Mail
, but show up in the config now as /Mail
... could probably make that cleaner.
I had a similar problem. I needed to pass ciphers parameter into ssl:
OfflineIMAP 8.0.0
Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v3.06, Python v3.11.6, OpenSSL 3.0.13 30 Jan 2024
Account sync main:
*** Processing account main
Establishing connection to XXXXXX:993 (main-remote)
ERROR: Unknown SSL protocol connecting to host 'XXXXXX' for repository 'main-remote'. OpenSSL responded:
[SSL: NO_CIPHERS_AVAILABLE] no ciphers available (_ssl.c:1006)
*** Finished account 'main' in 0:05
ERROR: Exceptions occurred during the run!
ERROR: Unknown SSL protocol connecting to host 'XXXXXX' for repository 'main-remote'. OpenSSL responded:
[SSL: NO_CIPHERS_AVAILABLE] no ciphers available (_ssl.c:1006)
Traceback:
File "/nix/store/i6wdj5klim3cwh5cxb1apc3vjaaqxv7y-offlineimap-8.0.0/lib/python3.11/site-packages/offlineimap/accounts.py", line 298, in syncrunner
self.__sync()
File "/nix/store/i6wdj5klim3cwh5cxb1apc3vjaaqxv7y-offlineimap-8.0.0/lib/python3.11/site-packages/offlineimap/accounts.py", line 374, in __sync
remoterepos.getfolders()
File "/nix/store/i6wdj5klim3cwh5cxb1apc3vjaaqxv7y-offlineimap-8.0.0/lib/python3.11/site-packages/offlineimap/repository/IMAP.py", line 681, in getfolders
imapobj = self.imapserver.acquireconnection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/i6wdj5klim3cwh5cxb1apc3vjaaqxv7y-offlineimap-8.0.0/lib/python3.11/site-packages/offlineimap/imapserver.py", line 663, in acquireconnection
raise OfflineImapError(reason, severity, exc_info()[2])
So my solution was to add transporttunnel
into config's remote section:
[Repository main-remote]
type = IMAP
remotehost = XXXXXX
remoteuser = <login>
remotepasseval = get_pass("main@XXXXXX")
auth_mechanisms = LOGIN
transporttunnel = openssl s_client -tls1 -cipher ALL:@SECLEVEL=0 -connect XXXXXX:993 -quiet
This approach works fine with python3.
I think this is an upstream issue:
though please correct me if I am wrong :-)
General information
offlineimap -V
): offlineimap v7.3.4, imaplib2 v2.101 (bundled)Configuration file offlineimaprc
Note: I have played with setting
ssl_version
and disabling starttls.Logs, error
Steps to reproduce the error
offlineimap
SSL notes
The server uses TLS version 1. The standard OpenSSL configuration in Ubuntu 22.04 does not allow the protocol. To get something useful, I use this openssl config (grabbed from stackoverflow):
Looking up the SSL information on the host (
OPENSSL_CONF=openssl_tls1.cnf openssl s_client -connect imap.cern.ch:993
):Input that openssl config blurb into the
/etc/ssl/openssl.cnf
, but that did not change the error when running offlineimap.What am I doing wrong?