Commit d7480c82 authored by Dominik Müller's avatar Dominik Müller
Browse files

Only Use LMTP in case of webserver->mailserver uid-mapping

Use dovecot or maildrop in default-cases
Switching to LMTP and back included in server-postfix-plugin
validator added to disable switching uid-mapping when already created mailusers or in multiserver-environment
parent b4f3f515
......@@ -22,7 +22,11 @@ $wb['mailuser_uid_txt'] = 'Mailuser UID';
$wb['mailuser_gid_txt'] = 'Mailuser GID';
$wb['mailuser_name_txt'] = 'Mailuser Name';
$wb['mailuser_group_txt'] = 'Mailuser Group';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
......
......@@ -24,7 +24,11 @@ $wb['mailuser_uid_txt'] = 'UID Pengguna Mail';
$wb['mailuser_gid_txt'] = 'GID Pengguna Mail';
$wb['mailuser_name_txt'] = 'Nama Pengguna Mail';
$wb['mailuser_group_txt'] = 'Grup Pengguna Mail';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Pengguna Relayhost';
$wb['relayhost_password_txt'] = 'Kata Sandi Relayhost';
......
......@@ -21,7 +21,11 @@ $wb['mailuser_uid_txt'] = 'Mailuser UID';
$wb['mailuser_gid_txt'] = 'Mailuser GID';
$wb['mailuser_name_txt'] = 'Mailuser Name';
$wb['mailuser_group_txt'] = 'Mailuser Group';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
......
......@@ -24,7 +24,11 @@ $wb['mailuser_uid_txt'] = 'メールユーザーのUID';
$wb['mailuser_gid_txt'] = 'メールユーザーのGID';
$wb['mailuser_name_txt'] = 'メールユーザー名';
$wb['mailuser_group_txt'] = 'メールユーザーグループ';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'リレーホスト';
$wb['relayhost_user_txt'] = 'リレーホストユーザー';
$wb['relayhost_password_txt'] = 'リレーホストパスワード';
......
......@@ -24,7 +24,11 @@ $wb['mailuser_uid_txt'] = 'Mailuser UID';
$wb['mailuser_gid_txt'] = 'Mailuser GID';
$wb['mailuser_name_txt'] = 'Mailuser name';
$wb['mailuser_group_txt'] = 'Mailuser groep';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost gebruiker';
$wb['relayhost_password_txt'] = 'Relayhost wachtwoord';
......
......@@ -24,7 +24,11 @@ $wb['mailuser_uid_txt'] = 'UID użytkownika e-mail';
$wb['mailuser_gid_txt'] = 'GID użytkownika e-mail';
$wb['mailuser_name_txt'] = 'Nazwa użytkownika e-mail';
$wb['mailuser_group_txt'] = 'Grupa użytkownika e-mail';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Adres Relayhost';
$wb['relayhost_user_txt'] = 'Użytkownik Relayhost';
$wb['relayhost_password_txt'] = 'Hasło Relayhost';
......
......@@ -23,7 +23,11 @@ $wb['mailuser_uid_txt'] = 'UID utilizador de email';
$wb['mailuser_gid_txt'] = 'GID utilizador de email';
$wb['mailuser_name_txt'] = 'Nome utilizador de email';
$wb['mailuser_group_txt'] = 'Grupo utilizador de email';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Host Relay';
$wb['relayhost_user_txt'] = 'Utilizador do Host Relay';
$wb['relayhost_password_txt'] = 'Senha do Host Relay';
......
......@@ -23,7 +23,11 @@ $wb['mailuser_uid_txt'] = 'Mailuser UID';
$wb['mailuser_gid_txt'] = 'Mailuser GID';
$wb['mailuser_name_txt'] = 'Mailuser Name';
$wb['mailuser_group_txt'] = 'Mailuser Group';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
......
......@@ -21,7 +21,11 @@ $wb['mailuser_uid_txt'] = 'Mailuser UID';
$wb['mailuser_gid_txt'] = 'Mailuser GID';
$wb['mailuser_name_txt'] = 'Имя Mailuser';
$wb['mailuser_group_txt'] = 'Группа Mailuser';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relay-хост';
$wb['relayhost_user_txt'] = 'Логин Relay-хоста';
$wb['relayhost_password_txt'] = 'Пароль Relay-хоста';
......
......@@ -22,7 +22,11 @@ $wb['mailuser_uid_txt'] = 'Mailuser UID';
$wb['mailuser_gid_txt'] = 'Mailuser GID';
$wb['mailuser_name_txt'] = 'Mailuser Name';
$wb['mailuser_group_txt'] = 'Mailuser Group';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
......
......@@ -24,7 +24,11 @@ $wb['mailuser_uid_txt'] = 'Mailuser UID';
$wb['mailuser_gid_txt'] = 'Mailuser GID';
$wb['mailuser_name_txt'] = 'Mailuser Meno';
$wb['mailuser_group_txt'] = 'Mailuser Skupina';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost uživateľ';
$wb['relayhost_password_txt'] = 'Relayhost heslo';
......
......@@ -24,7 +24,11 @@ $wb['mailuser_uid_txt'] = 'Mail kullanıcısı UID';
$wb['mailuser_gid_txt'] = 'Mail kullanıcısı GID';
$wb['mailuser_name_txt'] = 'Mail kullanıcısı Adı';
$wb['mailuser_group_txt'] = 'Mail kullanıcısı Grubu';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox (only if both on the same server)';
$wb['mailbox_virtual_uidgid_maps_txt'] = 'Use Websites Linux uid for mailbox';
$wb['mailbox_virtual_uidgid_maps_info_txt'] = 'only in single web and mail-server-setup';
$wb['mailbox_virtual_uidgid_maps_error_nosingleserver'] = 'Uid cannot be mapped in multi-server-setup.';
$wb['mailbox_virtual_uidgid_maps_error_nodovecot'] = 'Uid-mapping can only be used with dovecot.';
$wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be changed if there are already mail users.';
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost Kullanıcı';
$wb['relayhost_password_txt'] = 'Relayhost Şifre';
......
......@@ -58,7 +58,7 @@
<div class="ctrlHolder">
<p class="label">{tmpl_var name='mailbox_virtual_uidgid_maps_txt'}</p>
<div class="multiField">
{tmpl_var name='mailbox_virtual_uidgid_maps'}
{tmpl_var name='mailbox_virtual_uidgid_maps'}&nbsp;{tmpl_var name='mailbox_virtual_uidgid_maps_info_txt'}
</div>
</div>
<div class="ctrlHolder">
......
......@@ -79,12 +79,12 @@ class postfix_server_plugin {
global $app, $conf;
// get the config
$app->uses("getconf");
$app->uses("getconf,system");
$old_ini_data = $app->ini_parser->parse_ini_string($data['old']['config']);
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
copy('/etc/postfix/main.cf', '/etc/postfix/main.cf~');
if($mail_config['relayhost'] != '') {
exec("postconf -e 'relayhost = ".$mail_config['relayhost']."'");
if($mail_config['relayhost_user'] != '' && $mail_config['relayhost_password'] != '') {
......@@ -137,6 +137,19 @@ class postfix_server_plugin {
}
exec("postconf -e 'smtpd_recipient_restrictions = ".implode(", ", $new_options)."'");
}
if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') {
// If dovecot switch to lmtp
if($app->system->is_installed('dovecot')) {
exec("postconf -e 'virtual_transport = lmtp:unix:private/dovecot-lmtp'");
}
}
else {
// If dovecot switch to dovecot
if($app->system->is_installed('dovecot')) {
exec("postconf -e 'virtual_transport = dovecot'");
}
}
exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'");
exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment