Dovecot integration on SME Server. This has been merged in SME Server and is only kept here for history
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
836 B
28 lines
836 B
#!/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
|
|
# and imaps 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 $dovecot = $c->get('dovecot') || $c->new_record('dovecot',
|
|
{ type => 'service',
|
|
status => 'enabled'});
|
|
|
|
my $imapStatus = $imap->prop('status') || 'enabled';
|
|
my $imapsStatus = $imaps->prop('status') || 'enabled';
|
|
|
|
if ($imapStatus eq 'enabled' or $imapsStatus eq 'enabled'){
|
|
$dovecot->set_prop('status', 'enabled');
|
|
}
|
|
else{
|
|
$dovecot->set_prop('status', 'disabled');
|
|
}
|
|
|
|
|