~muffinresearch/bzr-email/bzr-email-keychain

« back to all changes in this revision

Viewing changes to smtp_connection.py

  • Committer: Stuart Colville
  • Date: 2007-08-14 09:49:07 UTC
  • mfrom: (28.1.1 bzr-email)
  • Revision ID: scol@yahoo-inc.com-20070814094907-gg4k8faxcryl83w1
merged http://bazaar.launchpad.net/~muffinresearch/bzr-email/121146

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
            raise errors.BzrCommandError('SMTP server refused HELO: %d %s'
92
92
                                  % (e.smtp_code, e.smtp_error))
93
93
        except smtplib.SMTPAuthenticationError, e:
94
 
            raise errors.BzrCommandError(
95
 
                  'SMTP server refused authentication: %d %s' % 
96
 
                        (e.smtp_code, e.smtp_error))
 
94
            self._num_of_auth_attempts = self._num_of_auth_attempts + 1
 
95
            if self._num_of_auth_attempts == self._max_auth_attempts:
 
96
               raise errors.BzrCommandError('SMTP server refused authentication: %d %s'
 
97
                                    % (e.smtp_code, e.smtp_error))
 
98
            else:
 
99
               print "Authentication Failed"
 
100
               self._smtp_password = None
 
101
               self._authenticate()
97
102
        except smtplib.SMTPException, e:
98
103
            raise errors.BzrCommandError(str(e))
99
104