From 6c31d108c186a3f2c35fea37b65f67936f66a0e7 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 13 Oct 2011 11:14:40 -0700 Subject: [PATCH] Dovecot 2 doesn't need imaps and pop3s protocols https://www.virtualmin.com/node/19776 --- dovecot/dovecot-lib.pl | 13 ++++++++++++- dovecot/edit_net.cgi | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dovecot/dovecot-lib.pl b/dovecot/dovecot-lib.pl index 988d19c9..dd13d34d 100755 --- a/dovecot/dovecot-lib.pl +++ b/dovecot/dovecot-lib.pl @@ -4,7 +4,6 @@ BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); -@supported_protocols = ( "imap", "pop3", "imaps", "pop3s" ); @supported_auths = ( "anonymous", "plain", "digest-md5", "cram-md5", "apop" ); @mail_envs = ( undef, "maildir:~/Maildir", "mbox:~/mail/:INBOX=/var/mail/%u", "maildir:~/Maildir:mbox:~/mail/" ); @@ -392,6 +391,18 @@ foreach my $f (reverse(&unique(map { $_->{'file'} } @$conf))) { } } +# get_supported_protocols() +# Returns the list of usable protocols for the current Dovecot version +sub get_supported_protocols +{ +if (&get_dovecot_version() >= 2) { + return ( "imap", "pop3" ); + } +else { + return ( "imap", "pop3", "imaps", "pop3s" ); + } +} + 1; r diff --git a/dovecot/edit_net.cgi b/dovecot/edit_net.cgi index 16cd6c38..30d94aa5 100755 --- a/dovecot/edit_net.cgi +++ b/dovecot/edit_net.cgi @@ -9,6 +9,7 @@ print &ui_form_start("save_net.cgi", "post"); print &ui_table_start($text{'net_header'}, "width=100%", 4); # Mail protocols +@supported_protocols = &get_supported_protocols(); @protos = split(/\s+/, &find_value("protocols", $conf)); print &ui_table_row($text{'net_protocols'}, &ui_select("protocols", \@protos, -- 2.17.1