Subject: | ucfirst tls or accept both forms |
Hi Steffen,
this is not really critical but although it is documented, i just tried
the second time to just ucfirst all paramters to new() and fail
naturally with tls. In the moment it's the only lowercased parameter and
all other parameters are either ucfirst or accept bot forms. Attached
patch solves the problem.
Cheers, Mario
Subject: | ucfist_tls.diff |
--- /home/dom/opt/lib/perl5/share/perl/5.8.8/Net/ManageSieve.pm.orig 2009-07-31 11:39:25.076056211 +0200
+++ /home/dom/opt/lib/perl5/share/perl/5.8.8/Net/ManageSieve.pm 2009-07-31 11:46:35.250528135 +0200
@@ -47,7 +47,7 @@
use Net::ManageSieve;
- my $sieve = Net::ManageSieve->new('mailhost', tls => 'require')
+ my $sieve = Net::ManageSieve->new('mailhost', Tls => 'require')
or die "$@\n";
print "Cipher: ", $sieve->get_cipher(), "\n";
$sieve->login('user', 'password')
@@ -108,8 +108,8 @@
B<Debug> or B<debug> - enable debugging if true (default OFF)
-B<tls> - issue STARTTLS right after connect. If B<tls> is a HASH ref,
-the mode is in member C<mode>, otherwise C<tls> itself is the mode and
+B<Tls> - issue STARTTLS right after connect. If B<Tls> is a HASH ref,
+the mode is in member C<mode>, otherwise C<Tls> itself is the mode and
an empty SSL option HASH is passed to L<starttls()>. The C<mode> may be
one of C<require> to fail, if TLS negotiation fails, or C<auto>,
C<on> or C<yes>, if TLS is to attempt, but a failure is ignored.
@@ -127,7 +127,7 @@
$sieve = Net::ManageSieve->new(Host => [ 'mailhost', 'localhost:2008' ],
Timeout => 30,
- tls => {
+ Tls => {
mode => require,
SSL_ca_path => '/usr/ssl/cert',
}
@@ -184,6 +184,10 @@
$self->{_last_command} = '';
$self->{_debug} = 1 if $arg{Debug} || $arg{debug};
+ if ( defined( $arg{Tls} ) ) {
+ $arg{tls} = delete $arg{Tls};
+ }
+
foreach my $h (@{ref($host) ? $host : [ $host ]}) {
$arg{PeerAddr} = $h;
if($self->{fh} = IO::Socket::INET->new(%arg)) {