[PATCH] Add STARTTLS support

Johannes Stezenbach js at sig21.net
Tue Apr 5 20:59:42 BST 2011


On Tue, Apr 05, 2011 at 02:26:50PM +0200, Sebastian Spaeth wrote:
> +                            #try STARTTLS, then CRAM-MD5, then Plaintext
> +                            if 'STARTTLS' in imapobj.capabilities and not self.usessl:
>                                  self.ui.debug('imap',
> -                                                       'Attempting CRAM-MD5 authentication')
> +                                              'Attempting STARTTLS authentication')
> +                                imapobj.starttls()
> +                            elif 'AUTH=CRAM-MD5' in imapobj.capabilities:
> +                                self.ui.debug('imap',
> +                                              'Attempting CRAM-MD5 authentication')
>                                  try:
>                                      imapobj.authenticate('CRAM-MD5', self.md5handler)

This seems wrong to me,  STARTTLS does not replace authentication,
it only provides an encrypted channel, and auth is then done in the
usual way after STARTTLS.


Johannes




More information about the OfflineIMAP-project mailing list