--- trunk/lib/SVN/Notify.pm 2008-10-21 10:21:15.000000000 +0530
+++ /Users/dawood/Notify.pm 2008-10-21 11:16:44.000000000 +0530
@@ -1,13 +1,13 @@
package SVN::Notify;
-# $Id: Notify.pm 4332 2008-09-24 04:33:22Z david $
+# $Id: Notify.pm 4155 2008-07-31 03:32:55Z david $
use strict;
require 5.006_000;
use constant WIN32 => $^O eq 'MSWin32';
use constant PERL58 => $] > 5.007_000;
require Encode if PERL58;
-$SVN::Notify::VERSION = '2.79';
+$SVN::Notify::VERSION = '2.78';
# Make sure any output (such as from _dbpnt()) triggers no Perl warnings.
if (PERL58) {
@@ -296,9 +296,12 @@
svnnotify --smtp-authtype authtype
The authentication method to use for authenticating to the SMTP server. The
-available authentication types include "PLAIN", "NTLM", "CRAM_MD5", and
+available authentication types include "PLAIN", "NTLM", "CRAM_MD5",
"TLS "and
others. Consult the L<Authen::SASL|Authen::SASL> documentation for a
complete
list. Defaults to "PLAIN".
+=item smtp_port
+ svnnotify --smtp-port port
+smtp port to be used with TLS authentication. defaults to 25
=item encoding
@@ -899,6 +902,7 @@
'smtp-user=s' => \$opts->{smtp_user},
'smtp-pass=s' => \$opts->{smtp_pass},
'smtp-authtype=s' => \$opts->{smtp_authtype},
+ 'smtp-port=s' => \$opts->{smtp_port},
'add-header=s%' => sub {
shift; push @{ $opts->{add_headers}{+shift} }, shift
},
@@ -2367,7 +2371,7 @@
# Load Net::SMTP or the appropriate subclass.
my $smtp_class = do {
- if ($notifier->{smtp_user}) {
+ if ($notifier->{smtp_user}) {
require Net::SMTP_auth;
'Net::SMTP_auth';
} else {
@@ -2375,15 +2379,25 @@
'Net::SMTP';
}
};
+ #changed by Dawood
+ my $smtp;
+ if($notifier->{smtp_authtype} eq 'TLS')
+ {
+ require Net::SMTP::TLS;
+ $notifier->{smtp_port} = $notifier->{smtp_port} ?
$notifier->{smtp_port} : 25;
+ $smtp = Net::SMTP::TLS->new($notifier->{smtp},Port =>
$notifier->{smtp_port},User => $notifier->{smtp_user}, Password =>
$notifier->{smtp_pass});
+ }
+ else
+ {
+ $smtp = $smtp_class->new(
+ $notifier->{smtp},
+ ( $notifier->{verbose} > 1 ? ( Debug => 1 ) : ())
+ ) or die "Unable to create $smtp_class object: $!";
- my $smtp = $smtp_class->new(
- $notifier->{smtp},
- ( $notifier->{verbose} > 1 ? ( Debug => 1 ) : ())
- ) or die "Unable to create $smtp_class object: $!";
-
- $smtp->auth( @{ $notifier }{qw(smtp_authtype smtp_user smtp_pass)} )
- if $notifier->{smtp_user};
-
+ $smtp->auth( @{ $notifier }{qw(smtp_authtype smtp_user smtp_pass)} )
+ if $notifier->{smtp_user};
+ }
+# --------------------- Dawood changes end -------
$smtp->mail($notifier->{from});
$smtp->to(map { split /\s*,\s*/ } @{ $notifier->{to} });
$smtp->data;
On Mon Oct 20 09:57:46 2008, DWHEELER wrote:
Show quoted text> On Oct 20, 2008, at 01:52, Dawood S via RT wrote:
>
> > Hi,
> > I've added some code to SVN::Notify to be able to use with mail
> > server using TLS as auth e.g. gmail. Please let me know how do i send
> > those changes to you.
>
> Great. Please create a diff against a copy of the original source
> code, which you can check out from subversion here:
>
> svn co
https://svn.kineticode.com/SVN-Notify/trunk/
>
> If you can't use Subversion for some reason, please get the latest
> from CPAN and use `diff -u`.
>
> Thanks,
>
> David
>