Skip to content

Commit

Permalink
* Receive.pm (from_imap): add imap options to specify port (#195)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Faylor <cgf@realedsolutions.com>
Co-authored-by: Matt Simerson <matt@tnpi.net>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent 4d436e2 commit 11ca6a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Mail/DMARC/Report/Receive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 11ca6a4

Please sign in to comment.