In gmane.comp.version-control.subversion.trac.general, you wrote:
> --000e0cd24da23c20f70479d083e8
> Content-Type: text/plain; charset=ISO-8859-1
>
> {{{
> #!diff
> --- notification.py.orig        2009-12-02 22:49:08.000000000 +0800
> +++ notification.py     2009-12-03 13:16:38.000000000 +0800
> @@ -320,8 +320,24 @@
>              self.server.starttls()
>              self.server.ehlo()
>          if self.user_name:
> -            self.server.login(self.user_name.encode('utf-8'),
> +            from smtplib import SMTPAuthenticationError
> +            try:
> +                self.server.login(self.user_name.encode('utf-8'),
>                                self.password.encode('utf-8'))
> +            except SMTPAuthenticationError:
> +                # hack for Zmail 0.6
> +                import string
> +                if string.find(self.server.ehlo_resp, "AUTH LOGIN\n") == 0
>:
> +                    import base64
> +                    code,resp = self.server.docmd('AUTH', 'login')
> +                    if code != 334 :
> +                        raise SMTPAuthenticationError(code, resp)
> +                    code,resp =
> self.server.docmd(base64.b64encode(self.user_name.encode('utf-8')))
> +                    if code != 334 :
> +                        raise SMTPAuthenticationError(code, resp)
> +                    code,resp =
> self.server.docmd(base64.b64encode(self.password.encode('utf-8')))
> +                    if code != 235 :
> +                        raise SMTPAuthenticationError(code, resp)
> }}}

Rather then catch the exception, why don't you use a configuration
parameter?  It would be cleaner and more efficient.

--

You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.


Reply via email to