Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the SVN-Notify CPAN distribution.

Report information
The Basics
Id: 40188
Status: resolved
Priority: 0/
Queue: SVN-Notify

People
Owner: Nobody in particular
Requestors: dawood.s [...] gmail.com
Cc: GNUSTAVO [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.83



Subject: SVN::Notify - TLS as auth
Date: Mon, 20 Oct 2008 14:21:53 +0530
To: bugs-svn-notify [...] rt.cpan.org
From: Dawood S <dawood.s [...] gmail.com>
Download (untitled) / with headers
text/plain 184b
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. Thanks </Dawood>
Subject: Re: [rt.cpan.org #40188] SVN::Notify - TLS as auth
Date: Mon, 20 Oct 2008 06:57:22 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 515b
On Oct 20, 2008, at 01:52, Dawood S via RT wrote: Show quoted text
> 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
Download (untitled) / with headers
text/plain 3.4k
--- 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 >
Subject: Re: [rt.cpan.org #40188] SVN::Notify - TLS as auth
Date: Tue, 28 Oct 2008 18:12:57 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
Download (untitled) / with headers
text/plain 735b
On Oct 20, 2008, at 22:48, Dawood Sangameshwari via RT wrote: Show quoted text
> + #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}); > + }
Yow, that's kind of ugly. Why? Because one might still need to auth to the SMTP server using NLTM or something, all over TLS. Better would be for Net::SMTP to support TLS directly. I've asked for this: http://rt.cpan.org/Ticket/Display.html?id=40478 We'll see what happens. Thanks, David
Download (untitled) / with headers
text/plain 167b
Okay, switched to Net::SMTP::TLS [here](https://github.com/theory/svn- notify/commit/cb9237914235d3bef4f88e61324204179ef8b7eb). I plan to release it this week. David


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.