subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From João M. S. Silva <joao.m.santos.si...@gmail.com>
Subject Re: post-commit hook
Date Tue, 20 Dec 2016 22:37:42 GMT
On 12/13/2016 06:09 AM, Daniel Shahaf wrote:
> Yes, someone left a reply on the channel bot for you to see the next
> time you logged in.

Thanks, I didn't know/remember of such a feature. They said:

<wayita> jmss: on 2016-12-09 danielsh said: "SMTP AUTH" not supported 
*may* mean that STARTTLS is required, but there are other possible 
explanations
<wayita> jmss: on 2016-12-09 danielsh said: Double-check your smtp 
settings with your smtp vendor

> "smtp_use_ssl" is not a mailer.py configuration knob.

You are right. I took that setting from a site:

# added by jmss
# 
http://sadomovalex.blogspot.pt/2009/12/use-gmail-smtp-server-for-post-commit.html
smtp_use_ssl = true

Previously, I could only send mails with that setting I took from the 
above blog. It may have become obsolete?

> Try this patch, after configuring port 465 in the .conf file:
>
> Index: mailer.py
> ===================================================================
> --- mailer.py   (revision 1771121)
> +++ mailer.py   (working copy)
> @@ -291,7 +291,7 @@ class SMTPOutput(MailedOutput):
>      self.write(self.mail_headers(group, params))
>
>    def finish(self):
> -    server = smtplib.SMTP(self.cfg.general.smtp_hostname)
> +    server = smtplib.SMTP_SSL(self.cfg.general.smtp_hostname)
>      if self.cfg.is_set('general.smtp_username'):
>        server.login(self.cfg.general.smtp_username,
>                     self.cfg.general.smtp_password)
>
> It can't be committed as-is, but it might get your setup working.
> (Modulo certificate verification defaults...)
>
> https://docs.python.org/3/library/smtplib#smtplib.SMTP_SSL

mailer.py was a link to 
/usr/share/subversion/hook-scripts/mailer/mailer.py but I made a local 
copy and modified it according to your patch.

I was going to say it didn't work, but I forgot to change the port from 
587 to 465.

After changing the port to 465 it worked.

So, what is the correct/official way to solve this?

Thanks.

João M. S. Silva

Mime
View raw message