@@ -79,26 +79,29 @@ public function configure_dovecot()
7979
8080 //* Get the dovecot version
8181 exec ('dovecot --version ' , $ tmp );
82- $ parts = explode ('. ' , trim ($ tmp [0 ]));
83- $ dovecot_version = $ parts [0 ];
82+ $ dovecot_version = $ tmp [0 ];
8483 unset($ tmp );
85- unset($ parts );
8684
8785 //* Copy dovecot configuration file
88- if ($ dovecot_version == 2 ) {
86+ if (version_compare ( $ dovecot_version, 2 ) >= 0 ) {
8987 if (is_file ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/debian6_dovecot2.conf.master ' )) {
9088 copy ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/debian6_dovecot2.conf.master ' , $ config_dir .'/ ' .$ configfile );
9189 } else {
9290 copy ('tpl/debian6_dovecot2.conf.master ' , $ config_dir .'/ ' .$ configfile );
9391 }
9492 replaceLine ($ config_dir .'/ ' .$ configfile , 'postmaster_address = postmaster@example.com ' , 'postmaster_address = postmaster@ ' .$ conf ['hostname ' ], 1 , 0 );
93+ if (version_compare ($ dovecot_version ,2.1 ) < 0 ) {
94+ removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_protocols = ' );
95+ }
9596 } else {
9697 if (is_file ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/debian6_dovecot.conf.master ' )) {
9798 copy ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/debian6_dovecot.conf.master ' , $ config_dir .'/ ' .$ configfile );
9899 } else {
99100 copy ('tpl/debian6_dovecot.conf.master ' , $ config_dir .'/ ' .$ configfile );
100101 }
101102 }
103+
104+
102105
103106 //* dovecot-sql.conf
104107 $ configfile = 'dovecot-sql.conf ' ;
0 commit comments