Skip to content

Commit 466f06a

Browse files
author
Marius Cramer
committed
Merge branch 'master_fixes' into 'master'
Additional LMTP-Switch in Update-Case check switching to lmtp in update-case too See merge request !130
2 parents 559b657 + a8aad2c commit 466f06a

File tree

5 files changed

+70
-5
lines changed

5 files changed

+70
-5
lines changed

install/dist/lib/debian60.lib.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ class installer extends installer_base {
3333
public function configure_dovecot()
3434
{
3535
global $conf;
36+
37+
$virtual_transport = 'dovecot';
38+
39+
// check if virtual_transport must be changed
40+
if ($this->is_update) {
41+
$tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
42+
$ini_array = ini_to_array(stripslashes($tmp['config']));
43+
// ini_array needs not to be checked, because already done in update.php -> updateDbAndIni()
44+
45+
if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') {
46+
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
47+
}
48+
}
3649

3750
$config_dir = $conf['dovecot']['config_dir'];
3851

@@ -57,7 +70,7 @@ public function configure_dovecot()
5770
// Adding the amavisd commands to the postfix configuration
5871
$postconf_commands = array (
5972
'dovecot_destination_recipient_limit = 1',
60-
'virtual_transport = dovecot',
73+
'virtual_transport = '.$virtual_transport,
6174
'smtpd_sasl_type = dovecot',
6275
'smtpd_sasl_path = private/auth'
6376
);

install/dist/lib/fedora.lib.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,19 @@ public function configure_dovecot()
376376
{
377377
global $conf;
378378

379+
$virtual_transport = 'dovecot';
380+
381+
// check if virtual_transport must be changed
382+
if ($this->is_update) {
383+
$tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
384+
$ini_array = ini_to_array(stripslashes($tmp['config']));
385+
// ini_array needs not to be checked, because already done in update.php -> updateDbAndIni()
386+
387+
if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') {
388+
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
389+
}
390+
}
391+
379392
$config_dir = $conf['dovecot']['config_dir'];
380393

381394
//* Use /etc/dovecot as config dir if exists
@@ -402,7 +415,7 @@ public function configure_dovecot()
402415
// Adding the amavisd commands to the postfix configuration
403416
$postconf_commands = array (
404417
'dovecot_destination_recipient_limit = 1',
405-
'virtual_transport = dovecot',
418+
'virtual_transport = '.$virtual_transport,
406419
'smtpd_sasl_type = dovecot',
407420
'smtpd_sasl_path = private/auth',
408421
);

install/dist/lib/gentoo.lib.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,19 @@ public function configure_dovecot()
220220
{
221221
global $conf;
222222

223+
$virtual_transport = 'dovecot';
224+
225+
// check if virtual_transport must be changed
226+
if ($this->is_update) {
227+
$tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
228+
$ini_array = ini_to_array(stripslashes($tmp['config']));
229+
// ini_array needs not to be checked, because already done in update.php -> updateDbAndIni()
230+
231+
if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') {
232+
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
233+
}
234+
}
235+
223236
$config_dir = $conf['dovecot']['config_dir'];
224237

225238
$configfile = $conf['postfix']['config_dir'].'/master.cf';
@@ -245,7 +258,7 @@ public function configure_dovecot()
245258
//* Reconfigure postfix to use dovecot authentication
246259
$postconf_commands = array (
247260
'dovecot_destination_recipient_limit = 1',
248-
'virtual_transport = dovecot',
261+
'virtual_transport = '.$virtual_transport,
249262
'smtpd_sasl_type = dovecot',
250263
'smtpd_sasl_path = private/auth'
251264
);

install/dist/lib/opensuse.lib.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,19 @@ public function configure_dovecot()
430430
{
431431
global $conf;
432432

433+
$virtual_transport = 'dovecot';
434+
435+
// check if virtual_transport must be changed
436+
if ($this->is_update) {
437+
$tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
438+
$ini_array = ini_to_array(stripslashes($tmp['config']));
439+
// ini_array needs not to be checked, because already done in update.php -> updateDbAndIni()
440+
441+
if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') {
442+
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
443+
}
444+
}
445+
433446
$config_dir = $conf['dovecot']['config_dir'];
434447

435448
//* Configure master.cf and add a line for deliver
@@ -453,7 +466,7 @@ public function configure_dovecot()
453466
// Adding the amavisd commands to the postfix configuration
454467
$postconf_commands = array (
455468
'dovecot_destination_recipient_limit = 1',
456-
'virtual_transport = dovecot',
469+
'virtual_transport = '.$virtual_transport,
457470
'smtpd_sasl_type = dovecot',
458471
'smtpd_sasl_path = private/auth',
459472
);

install/lib/installer_base.lib.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,19 @@ public function configure_courier() {
933933

934934
public function configure_dovecot() {
935935
global $conf;
936+
937+
$virtual_transport = 'dovecot';
938+
939+
// check if virtual_transport must be changed
940+
if ($this->is_update) {
941+
$tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
942+
$ini_array = ini_to_array(stripslashes($tmp['config']));
943+
// ini_array needs not to be checked, because already done in update.php -> updateDbAndIni()
944+
945+
if(isset($ini_array['mail']['mailbox_virtual_uidgid_maps']) && $ini_array['mail']['mailbox_virtual_uidgid_maps'] == 'y') {
946+
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
947+
}
948+
}
936949

937950
$config_dir = $conf['dovecot']['config_dir'];
938951

@@ -957,7 +970,7 @@ public function configure_dovecot() {
957970
// Adding the amavisd commands to the postfix configuration
958971
$postconf_commands = array (
959972
'dovecot_destination_recipient_limit = 1',
960-
'virtual_transport = dovecot',
973+
'virtual_transport = '.$virtual_transport,
961974
'smtpd_sasl_type = dovecot',
962975
'smtpd_sasl_path = private/auth'
963976
);

0 commit comments

Comments
 (0)