~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smtp_connection.py

  • Committer: Robert J. Tanner
  • Date: 2009-04-20 08:37:32 UTC
  • mfrom: (4299 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4300.
  • Revision ID: tanner@real-time.com-20090420083732-bzx919oo7wpmqc2u
[merge] 1.14rc2 back into bzr.dev (Bob Tanner)

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
            return
65
65
 
66
66
        self._create_connection()
 
67
        # FIXME: _authenticate() should only be called when the server has
 
68
        # refused unauthenticated access, so it can safely try to authenticate 
 
69
        # with the default username. JRV20090407
67
70
        self._authenticate()
68
71
 
69
72
    def _create_connection(self):
103
106
        """If necessary authenticate yourself to the server."""
104
107
        auth = config.AuthenticationConfig()
105
108
        if self._smtp_username is None:
106
 
            self._smtp_username = auth.get_user('smtp', self._smtp_server)
107
 
            if self._smtp_username is None:
 
109
            # FIXME: Since _authenticate gets called even when no authentication
 
110
            # is necessary, it's not possible to use the default username 
 
111
            # here yet.
 
112
            self._smtp_username = auth.get_user('smtp', self._smtp_server, 
 
113
                default="")
 
114
            if self._smtp_username == "":
108
115
                return
109
116
 
110
117
        if self._smtp_password is None: