1

I am configuring my SVN server to send an email when some one commit code to the repository. After some googling I am using bellow codes for post-commit. I would like to use gmail SMTP as a mail server. But I am ending up with error..

"post-commit hook failed (exit code 255) with no output."

My Configuration Files:

post-commit

REPOS="$1"
REV="$2"

/SVNData/testrepo/hooks/mailer.py commit "$REPOS" \
"$REV" /SVNData/testrepo/hooks/mailer.conf

mailer.py Additional Config

  def finish(self):
server = smtplib.SMTP(self.cfg.general.smtp_hostname)

if self.cfg.is_set('general.smtp_use_ssl') and self.cfg.general.smtp_use_ssl.lower() == "true":
   server.ehlo()
   server.starttls()
   server.ehlo()


if self.cfg.is_set('general.smtp_username'):
  server.login(self.cfg.general.smtp_username,
               self.cfg.general.smtp_password)
server.sendmail(self.from_addr, self.to_addrs, self.buffer.getvalue())
server.quit()

mailer.conf

[general]
smtp_hostname = smtp.gmail.com:587
smtp_username = mysvnemail.test2015@gmail.com
smtp_password = MyPassword+12345
smtp_use_ssl = true
smtp_use_tls = 1
from_addr = svnadmin@myoffice.net
to_addr = myemail@myoffice.com
reply_to = info@myoffice.net

When I commit a file from SVN client I am not getting any email and I am getting the error as..

post-commit hook failed (exit code 255) with no output.

0 Answers0