From 11ca6a472a0f52f917a5a20e215c6d1e44d19532 Mon Sep 17 00:00:00 2001 From: cgf <32742475+cgf1@users.noreply.github.com> Date: Wed, 14 Feb 2024 19:47:01 -0500 Subject: [PATCH] * Receive.pm (from_imap): add imap options to specify port (#195) Co-authored-by: Chris Faylor Co-authored-by: Matt Simerson --- lib/Mail/DMARC/Report/Receive.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Mail/DMARC/Report/Receive.pm b/lib/Mail/DMARC/Report/Receive.pm index efe242bf..050e4348 100644 --- a/lib/Mail/DMARC/Report/Receive.pm +++ b/lib/Mail/DMARC/Report/Receive.pm @@ -27,11 +27,12 @@ sub from_imap { my $folder = $self->config->{imap}{folder} or croak "no imap folder conf"; my $a_done = $self->config->{imap}{a_done}; my $f_done = $self->config->{imap}{f_done}; - my $port = $self->get_imap_port(); + my $port = $self->config->{imap}{port} // $self->get_imap_port(); + my $use_ssl = $self->config->{imap}{use_ssl} // ($port==993); no warnings qw(once); ## no critic (Warn) - my $imap = Net::IMAP::Simple->new( $server, Port => $port, - ($port==993 ? (use_ssl => 1) : ()), + my $imap = Net::IMAP::Simple->new( $server, port => $port, + ($use_ssl) ? (use_ssl=>$use_ssl) : () ) or do { ## no critic (PackageVar)