summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2015-04-11 10:38:09 (GMT)
committermh <mh@immerda.ch>2015-04-11 10:38:52 (GMT)
commite61b0567f2d0550b5bf3d9d11572e94e4bfc59e3 (patch)
tree35f8cd3da3cec88846e4ed949db7c7b455cbef25
parent2307124f6d4f63ea89655ad7eef34741685bb1c5 (diff)
migrate to a newer script that verifies ssl
-rwxr-xr-xfiles/imap-auth.pl7
-rw-r--r--manifests/base.pp7
-rw-r--r--manifests/init.pp7
-rw-r--r--manifests/selinux.pp3
4 files changed, 12 insertions, 12 deletions
diff --git a/files/imap-auth.pl b/files/imap-auth.pl
index 9f616c1..1eb00b5 100755
--- a/files/imap-auth.pl
+++ b/files/imap-auth.pl
@@ -1,4 +1,4 @@
-use Net::IMAP::Simple::SSL;
+use Net::IMAP::Simple;
sub imapLogin {
my $host = shift;
@@ -6,7 +6,10 @@ sub imapLogin {
my $password = shift;
# open a connection to the IMAP server
- if (! ($server = Net::IMAP::Simple::SSL->new($host))) {
+ if (! ($server = Net::IMAP::Simple->new($host, use_ssl => 1,
+ find_ssl_defaults => [
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_PEER,
+ ],))) {
return 0;
}
diff --git a/manifests/base.pp b/manifests/base.pp
index f2dd61f..359c5fc 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,11 +1,8 @@
# install everything needed for the imap auth
class exim_imap_auth::base {
- package { [ 'perl-Net-IMAP-Simple-SSL',
- 'perl-Net-IMAP-Simple', ]:
+ package {'perl-Net-IMAP-Simple':
ensure => present,
- }
-
- file{'/etc/exim/imap-auth.pl':
+ } -> file{'/etc/exim/imap-auth.pl':
source => 'puppet:///modules/exim_imap_auth/imap-auth.pl',
require => Package['exim'],
before => Service['exim'],
diff --git a/manifests/init.pp b/manifests/init.pp
index 94255e4..0be0500 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,9 +1,8 @@
-# manifests/init.pp - module to manage exim imap auth
-
+# module to manage exim imap auth
class exim_imap_auth {
- include exim_imap_auth::base
+ include ::exim_imap_auth::base
if str2bool($::selinux) {
- include exim_imap_auth::selinux
+ include ::exim_imap_auth::selinux
}
}
diff --git a/manifests/selinux.pp b/manifests/selinux.pp
index 41754a3..d3e70f5 100644
--- a/manifests/selinux.pp
+++ b/manifests/selinux.pp
@@ -1,6 +1,7 @@
# exim needs to connect to various ports
class exim_imap_auth::selinux {
- if ($::osfamily == 'RedHat') and ($::operatingsystemmajrelease > 5) {
+ if ($::osfamily == 'RedHat') and
+ versioncmp($::operatingsystemmajrelease,'6') == 0 {
selboolean{
'allow_ypbind':
value => 'on',