Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions check_email_delivery
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ my $username = "";
my $password = "";
my $ssl = "";
my $imap_ssl = "";
my $imap_ssl_verify = 1;
my $mailto = "";
my $mailfrom = "";
my @header = ();
Expand Down Expand Up @@ -93,6 +94,7 @@ $ok = Getopt::Long::GetOptions(
"imap-mailbox=s"=>\$imap_mailbox,
"imap-check-interval=i"=>\$imap_interval,"imap-retries=i"=>\$imap_retries,
"imapssl!"=>\$imap_ssl,
"imapsslverify!"=>\$imap_ssl_verify,
# Time
"hires"=>\$time_hires,
);
Expand Down Expand Up @@ -201,6 +203,7 @@ $imap_options .= "-U ".shellquote($imap_username)." " if defined $imap_username
$imap_options .= "-P ".shellquote($imap_password)." " if defined $imap_password and $imap_password ne "";
$imap_options .= "--mailbox ".shellquote($imap_mailbox)." " if defined $imap_mailbox and $imap_mailbox ne "";
$imap_options .= "--ssl " if defined $imap_ssl and $imap_ssl;
$imap_options .= "--no-verify-ssl " if defined $imap_ssl_verify and !$imap_ssl_verify;


# create the report object
Expand Down Expand Up @@ -693,6 +696,13 @@ Use this to enable or disable SSL for the IMAP plugin.

This argument is shell-escaped; special characters or angle brackets around the address are ok.

=item --imapsslverify
=item --noimapsslverify

Use this to enable or disable SSL verfiy for the IMAP plugin.

This argument is shell-escaped; special characters or angle brackets around the address are ok.

=item --smtptls
=item --nosmtptls

Expand Down
10 changes: 10 additions & 0 deletions check_imap_receive
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ my $template = "";
my $ssl = 0;
my $ssl_ca_file = "";
my $tls = 0;
my $verify_ssl = 1;
my $time_hires = "";
my $ok;
$ok = Getopt::Long::GetOptions(
Expand All @@ -62,6 +63,7 @@ $ok = Getopt::Long::GetOptions(
"U|username=s"=>\$username,"P|password=s"=>\$password, "m|mailbox=s"=>\$mailbox,
"imap-check-interval=i"=>\$interval,"imap-retries=i"=>\$max_retries,
"ssl!"=>\$ssl, "ssl-ca-file=s"=>\$ssl_ca_file, "tls!"=>\$tls,
"verify-ssl!"=>\$verify_ssl,
# search settings
"s|search=s"=>\@search,
"search-critical-min=i"=>\$search_critical_min, "search-critical-max=i"=>\$search_critical_max,
Expand Down Expand Up @@ -135,6 +137,8 @@ eval {
$ssl_args{SSL_ca_file} = $ssl_ca_file;
$ssl_args{SSL_verifycn_scheme} = 'imap';
$ssl_args{SSL_verifycn_name} = $imap_server;
} elsif ( !$verify_ssl ) {
$ssl_args{SSL_verify_mode} = 0;
}
my $socket = IO::Socket::SSL->new(PeerAddr=>"$imap_server:$imap_port", %ssl_args);
die IO::Socket::SSL::errstr() . " (if you get this only when using both --ssl and --ssl-ca-file, but not when using just --ssl, the server SSL certificate failed validation)" unless $socket;
Expand Down Expand Up @@ -700,6 +704,12 @@ override this from the command line using the --port option.

Use the nossl option to turn off the ssl option.

=item --verifyssl

=item --noverifyssl

Enable SSL verfiy when connecting to imap server.

=item --ssl-ca-file

Use this to verify the server SSL certificate against a local .pem file. You'll need to
Expand Down