initial commit of file from CVS for smeserver-dovecot on Thu 26 Oct 11:25:44 BST 2023

This commit is contained in:
2023-10-26 11:25:44 +01:00
parent 1cc640641d
commit ca0b639483
61 changed files with 766 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
#!/usr/bin/perl -w
# This script just ensure the dovecot service is enabled
# if imap or imaps is enabled
# It will also entirely disable the dovecot service if both imap,
# imaps pop3 and pop3s are disabled
use esmith::ConfigDB;
my $c = esmith::ConfigDB->open() or die "Couldn't open Config DB\n";
my $imap = $c->get('imap');
my $imaps = $c->get('imaps');
my $pop = $c->get('pop3');
my $pops = $c->get('pop3s');
my $dovecot = $c->get('dovecot') || $c->new_record('dovecot',
{ type => 'service',
status => 'enabled'});
my $imapStatus = $imap->prop('status') || 'enabled';
my $imapsStatus = $imaps->prop('status') || 'enabled';
my $popStatus = $pop->prop('status') || 'enabled';
my $popsStatus = $pops->prop('status') || 'enabled';
if ($imapStatus eq 'enabled' or $imapsStatus eq 'enabled' or $popStatus eq 'enabled' or $popsStatus eq 'enabled'){
$dovecot->set_prop('status', 'enabled');
}
else{
$dovecot->set_prop('status', 'disabled');
}
# also if /etc/pam.d/pop3 exists we unlink it, as it was needed by former e-smith-pop3
unlink('/etc/pam.d/pop3');