1

I've spent a lot of time yet. But I'm still stuck.

I run Ubuntu 12.04.

I have set up SVN and it's working fine. Now I want to send nice E-Mails on each commit, so I installd svnnotify and applied the --css-inlne patch. (post).

Less secure access is on, I can send E-Mails using phpmailer.

After many hours spent on googleing I ask you.

I've tried the following:

post-commit:

#!/bin/sh

REV=$2
REPO=$1

/usr/local/bin/trac-admin /var/www/trac/htdocs/share changeset added "svn" $REV

# email notifications for commits
/usr/bin/svnnotify --repos-path "$REPO" --revision "$REV"   \
    --smtp          smtp.gmail.com                          \
    --smtp-port     587                                     \
    --smtp-user     noreply@donbolli.ch                     \
    --smtp-pass     pass                                    \
    --smtp-tls                                              \
    --to            receiver@gmail.com                      \
    --from          noreply@donbolli.ch                     \
    --with-diff                                             \
    --subject-cx                                            \
    --subject-prefix        'Share: '                       \
    --handler HTML::ColorDiff                               \
    --css-inline
    2>&1 &

exit 0

Results in:

donbolli@luna585:~$ ./post-commit /var/www/svn/share 9
Couldn't start TLS: SSL connect attempt failed because of handshake problems error:1409442E:SSL routines:SSL3_READ_BYTES:tlsv1 alert protocol version
 at /usr/share/perl5/SVN/Notify.pm line 2390.

So I was looking for this error, but found nothing.

So I tried another approach

post-commit:

#!/bin/sh

REV=$2
REPO=$1

/usr/local/bin/trac-admin /var/www/trac/htdocs/share changeset added "svn" $REV

# email notifications for commits
/usr/bin/svnnotify --repos-path "$REPO" --revision "$REV"   \
    --sendmail      /home/donbolli/sendmail.py              \
    --to            receiver@gmail.com          \
    --from          noreply@donbolli.ch                     \
    --with-diff                                             \
    --subject-cx                                            \
    --subject-prefix        'Share: '                       \
    --handler HTML::ColorDiff                               \
    --css-inline
    2>&1 &

exit 0

Results in

donbolli@luna585:~$ ./post-commit /var/www/svn/share 9
Can't exec "/home/donbolli/sendmail.py": No such file or directory at /usr/share/perl5/SVN/Notify.pm line 2332.
Cannot exec /home/donbolli/sendmail.py: No such file or directory

But the file exists (and is 755)

donbolli@luna585:~$ cat /home/donbolli/sendmail.py
#!/usr/bin/perl
use MIME::Lite;
use Net::SMTPS;

my $msg = MIME::Lite ->new (
From => 'noreply@donbolli.ch',
To => 'receiver@gmail.com',
Type => 'text/html; charset=UTF-8'
);

...
Community
  • 1
  • 1
Christian Bohli
  • 331
  • 1
  • 4
  • 15

1 Answers1

0

my post-commit;

#!/bin/sh

REV=$2
REPO=$1

/usr/local/bin/trac-admin /var/www/trac/htdocs/share changeset added "svn" $REV

# email notifications for commits
/usr/bin/svnnotify --repos-path "$REPO" --revision "$REV"  \
 --sendmail  /usr/sbin/sendmail      \
 --to   recriver@gmail.com          \
    --from   noreply@donbolli.ch      \
    --with-diff            \
    --subject-cx           \
    --subject-prefix  'Share: '      \
    --handler HTML::ColorDiff        \
    --css-inline
    2>&1 &

exit 0

Works after I followed the sendmail instructions.

Thanks to xxfelixxx

install sendmail

Community
  • 1
  • 1
Christian Bohli
  • 331
  • 1
  • 4
  • 15
  • The usage said sendmail executable. I didn't know it means that you have to use sendmail I thought you could use any executable there. Thank you again! – Christian Bohli Jun 20 '16 at 19:15