Sebastian Spaeth Sebastian at
Sat May 7 17:26:22 BST 2011

On Sat, 7 May 2011 14:03:59 +0200, Nicolas Sebrecht <nicolas.s-dev at> wrote:
> > > E.g. something like this at the right place:
> > > 
> > > except ssl.error, e:
> > >     if repository.getint('port') != 443 and str(e)=='SSL:bla bla':
> > >         raise SyntaxWarning('SSL version could not be detected and '
> > >     'non-standard port %d for SSL configured. Make sure your'
> > >     'configuration is correct.' % repository.getint('port'))
> > 
> > Would be nice to have a patch for this. I expect this is a _common_
> > issue...
> I didn't see much improvements around this. Anyone? Really?

*sigh*. I had hoped someone steps up. Anyway, I did this now and it gave
me the opportunity to introduce more OfflineImapErrors :-). I noticed
that we can throw 2 different things when we misconfigure the port. If
it points to a nonexisting service, we will get a socket.error
"Connection refused". This now outputs the following message:

WARNING: Connection to host '' for repository 'Remote' was refused. Make sure you have the right host and port configured and that you are actually able to access the network.

If we configure to use SSL but point to a non-ssl port, we will get the
weird SSL error. In this case we now get the output:

WARNING: Could not connect via SSL to host '' and non-standard ssl port 143 configured. Make sure you connect to the correct port.

I hope this is what we wanted to achieve. BTW, the "Connection refused"
will also be thrown if you are behind a proxy and are not authorized,
e.g. on an open WLAN that requires authorization. That is why I added
the text: "make sure [...] that you are actually able to access the

Patches against next coming up (2nd patch fixes a broken string formatting).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the OfflineIMAP-project mailing list