aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-09-10 20:19:36 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-09-10 20:36:57 +0200
commit705ea1c708c676587ae4833fc1fca5caafe1dd7f (patch)
tree782c38540d494259e3b24ad608edfe5b345fb37a /lib
parent5e127a1b56879ee24bcdf56c9c1eeb4f7dac4bc4 (diff)
Don't warn that no compression is enabled if the server doesn't support it.
Diffstat (limited to 'lib')
-rw-r--r--lib/Net/IMAP/InterIMAP.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm
index ee8677a..076ec19 100644
--- a/lib/Net/IMAP/InterIMAP.pm
+++ b/lib/Net/IMAP/InterIMAP.pm
@@ -371,7 +371,7 @@ sub new($%) {
@caps = $self->capabilities();
}
- my @mechs = ('LOGIN', grep defined, map { /^AUTH=(.+)/ ? $1 : undef } @caps);
+ my @mechs = ('LOGIN', grep defined, map { /^AUTH=(.+)/i ? $1 : undef } @caps);
my $mech = (grep defined, map {my $m = $_; (grep {$m eq $_} @mechs) ? $m : undef}
split(/ /, $self->{auth}))[0];
$self->fail("Failed to choose an authentication mechanism") unless defined $mech;
@@ -411,9 +411,9 @@ sub new($%) {
$self->{_STATE} = 'AUTH';
# Don't send the COMPRESS command before STARTTLS or AUTH, as per RFC 4978
- if (uc ($self->{compress} // 'NO') eq 'YES') {
+ if (uc ($self->{compress} // 'NO') eq 'YES' and
+ my @algos = grep defined, map { /^COMPRESS=(.+)/i ? uc $1 : undef } @{$self->{_CAPABILITIES}}) {
my @supported = qw/DEFLATE/; # supported compression algorithms
- my @algos = grep defined, map { /^COMPRESS=(.+)/ ? uc $1 : undef } @{$self->{_CAPABILITIES}};
my $algo = first { my $x = $_; grep {$_ eq $x} @algos } @supported;
if (!defined $algo) {
$self->warn("Couldn't find a suitable compression algorithm. Not enabling compression.");