Commit 03b63368 authored by Dominik's avatar Dominik

New parameter reject_sender_login_mismatch

Added prefetching to dovecot to halve database-queries
Added mdbox-creation for new Mailboxes in mdbox-format

Conflicts:
	install/tpl/debian6_dovecot-sql.conf.master
	install/tpl/debian_dovecot-sql.conf.master
	install/tpl/debian_postfix.conf.master
	install/tpl/fedora_dovecot-sql.conf.master
	install/tpl/fedora_postfix.conf.master
	install/tpl/gentoo_postfix.conf.master
	install/tpl/opensuse_dovecot-sql.conf.master
	install/tpl/opensuse_postfix.conf.master
	interface/web/admin/templates/server_config_mail_edit.htm
	server/cron_daily.php
	server/plugins-available/mail_plugin.inc.php
	server/plugins-available/postfix_server_plugin.inc.php
parent 7570f811
......@@ -143,6 +143,9 @@ class installer_dist extends installer_base {
//* mysql-virtual_sender.cf
$this->process_postfix_config('mysql-virtual_sender.cf');
//* mysql-virtual_sender_login_maps.cf
$this->process_postfix_config('mysql-virtual_sender_login_maps.cf');
//* mysql-virtual_client.cf
$this->process_postfix_config('mysql-virtual_client.cf');
......
......@@ -159,6 +159,9 @@ class installer_dist extends installer_base {
//* mysql-virtual_sender.cf
$this->process_postfix_config('mysql-virtual_sender.cf');
//* mysql-virtual_sender_login_maps.cf
$this->process_postfix_config('mysql-virtual_sender_login_maps.cf');
//* mysql-virtual_client.cf
$this->process_postfix_config('mysql-virtual_client.cf');
......
......@@ -694,6 +694,9 @@ class installer_base {
//* mysql-virtual_sender.cf
$this->process_postfix_config('mysql-virtual_sender.cf');
//* mysql-virtual_sender_login_maps.cf
$this->process_postfix_config('mysql-virtual_sender_login_maps.cf');
//* mysql-virtual_client.cf
$this->process_postfix_config('mysql-virtual_client.cf');
......
......@@ -13,8 +13,9 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}'
# password-query with prefetch
password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}'
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
......
......@@ -11,6 +11,9 @@ passdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
userdb {
driver = prefetch
}
userdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
......
......@@ -120,8 +120,9 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
# password-query with prefetch
password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
......
......@@ -1006,8 +1006,8 @@ auth default {
# This can be made to work with SQL and LDAP databases, see their example
# configuration files for more information how to do it.
# <doc/wiki/UserDatabase.Prefetch.txt>
#userdb prefetch {
#}
userdb prefetch {
}
# User to use for the process. This user needs access to only user and
# password databases, nothing else. Only shadow and pam authentication
......
......@@ -12,6 +12,9 @@ passdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
userdb {
driver = prefetch
}
userdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
......
......@@ -22,7 +22,8 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
......@@ -133,8 +133,9 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}'
# password-query with prefetch
password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
......
......@@ -1039,8 +1039,8 @@ auth default {
# This can be made to work with SQL and LDAP databases, see their example
# configuration files for more information how to do it.
# <doc/wiki/UserDatabase.Prefetch.txt>
#userdb prefetch {
#}
userdb prefetch {
}
# System users (NSS, /etc/passwd, or similiar). In many systems nowadays this
# uses Name Service Switch, which is configured in /etc/nsswitch.conf.
......
......@@ -11,6 +11,9 @@ passdb {
args = /etc/dovecot-sql.conf
driver = sql
}
userdb {
driver = prefetch
}
userdb {
args = /etc/dovecot-sql.conf
driver = sql
......@@ -57,4 +60,4 @@ protocol lda {
protocol lmtp {
postmaster_address = webmaster@localhost
mail_plugins = quota sieve
}
\ No newline at end of file
}
......@@ -19,7 +19,8 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
......@@ -18,7 +18,8 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
query = SELECT destination FROM mail_forwarding WHERE source = '%s' AND active = 'y' AND type = 'alias' AND server_id = 1 UNION SELECT email FROM mail_user WHERE email = '%s' AND disablesmtp = 'n' AND server_id = {server_id};
hosts = {mysql_server_ip}
\ No newline at end of file
......@@ -133,8 +133,9 @@ driver = mysql
connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password}
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n' AND server_id = '{server_id}'
# password-query with prefetch
password_query = SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n' AND server_id = '{server_id}'
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
......
......@@ -1033,8 +1033,8 @@ auth default {
# This can be made to work with SQL and LDAP databases, see their example
# configuration files for more information how to do it.
# <doc/wiki/UserDatabase.Prefetch.txt>
#userdb prefetch {
#}
userdb prefetch {
}
# System users (NSS, /etc/passwd, or similiar). In many systems nowadays this
# uses Name Service Switch, which is configured in /etc/nsswitch.conf.
......
......@@ -11,6 +11,9 @@ passdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
userdb {
driver = prefetch
}
userdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
......
......@@ -21,7 +21,8 @@ smtpd_tls_key_file = {config_dir}/smtpd.key
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:{config_dir}/mysql-virtual_transports.cf
relay_domains = mysql:{config_dir}/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:{config_dir}/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
smtpd_sender_login_maps = proxy:mysql:{config_dir}/mysql-virtual_sender_login_maps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
smtpd_sender_restrictions = check_sender_access mysql:{config_dir}/mysql-virtual_sender.cf regexp:{config_dir}/tag_as_originating.re, permit_mynetworks, check_sender_access regexp:{config_dir}/tag_as_foreign.re
smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
......
......@@ -434,6 +434,12 @@ $form["tabs"]['mail'] = array(
'width' => '40',
'maxlength' => '255'
),
'reject_sender_login_mismatch' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'mailbox_size_limit' => array(
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit';
$wb['message_size_limit_txt'] = 'Message Size Limit';
$wb['ip_address_txt'] = 'IP Address';
......
......@@ -30,6 +30,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit';
$wb['message_size_limit_txt'] = 'Message Size Limit';
$wb['ip_address_txt'] = 'IP адрес';
......
......@@ -31,6 +31,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Host Relay';
$wb['relayhost_user_txt'] = 'Usuário do Host Relay';
$wb['relayhost_password_txt'] = 'Senha do Host Relay';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Tamanho máximo da Caixa Postal';
$wb['message_size_limit_txt'] = 'Tamanho máximo de mensagem';
$wb['ip_address_txt'] = 'Endereço IP';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost uživatel';
$wb['relayhost_password_txt'] = 'Relayhost heslo';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Limit velikosti mailboxu';
$wb['message_size_limit_txt'] = 'Limit velikosti zprávy';
$wb['ip_address_txt'] = 'IP adresa';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid Mapping kann nur um
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost Benutzer';
$wb['relayhost_password_txt'] = 'Relayhost Passwort';
$wb['reject_sender_login_mismatch_txt'] = 'Zurückweisen von Mails, wenn Sender nicht gleich Login';
$wb['mailbox_size_limit_txt'] = 'E-Mailkonto Beschränkung';
$wb['message_size_limit_txt'] = 'E-Mailgrößen Beschränkung';
$wb['ip_address_txt'] = 'IP Adresse';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Χρήστης Relayhost';
$wb['relayhost_password_txt'] = 'Συνθηματικό Relayhost';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Όριο χώρου θυρίδας';
$wb['message_size_limit_txt'] = 'Μήνυμα ορίου χώρου';
$wb['ip_address_txt'] = 'Διεύθυνση IP';
......
......@@ -43,6 +43,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb["relayhost_txt"] = 'Relayhost';
$wb["relayhost_user_txt"] = 'Relayhost User';
$wb["relayhost_password_txt"] = 'Relayhost Password';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb["mailbox_size_limit_txt"] = 'Mailbox Size Limit';
$wb["message_size_limit_txt"] = 'Message Size Limit';
$wb["ip_address_txt"] = 'IP Address';
......
......@@ -30,6 +30,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Servidor de retransmisión';
$wb['relayhost_user_txt'] = 'Usuario de retransmisión';
$wb['relayhost_password_txt'] = 'Contraseña de retramisión';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Límite de tamaño del buzón';
$wb['message_size_limit_txt'] = 'Límite de tamaño del mensaje';
$wb['ip_address_txt'] = 'Dirección IP';
......
......@@ -30,6 +30,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Edelleenlähetyspalvelin';
$wb['relayhost_user_txt'] = 'Edelleenlähetyspalvelimen käyttäjätunnus';
$wb['relayhost_password_txt'] = 'Edelleenlähetyspalvelimen salasana';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Postilaatikon koko';
$wb['message_size_limit_txt'] = 'Viestien enimmäiskoko';
$wb['ip_address_txt'] = 'IP-osoite';
......
......@@ -25,6 +25,7 @@ $wb['mailuser_group_txt'] = 'Groupe de l\'utilisateur mail';
$wb['relayhost_txt'] = 'Hôde relais';
$wb['relayhost_user_txt'] = 'Utilisateur du relais';
$wb['relayhost_password_txt'] = 'Mot de passe du relais';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Taille maximale de la boite mail';
$wb['message_size_limit_txt'] = 'Taille maximale des messages';
$wb['ip_address_txt'] = 'Adresse IP';
......
......@@ -31,6 +31,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost korisnik';
$wb['relayhost_password_txt'] = 'Relayhost šifra';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Dozvoljena veličina mailboxa';
$wb['message_size_limit_txt'] = 'Dozvoljena veličina emaila';
$wb['ip_address_txt'] = 'IP adresa';
......
......@@ -30,6 +30,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit';
$wb['message_size_limit_txt'] = 'Message Size Limit';
$wb['ip_address_txt'] = 'IP Address';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Pengguna Relayhost';
$wb['relayhost_password_txt'] = 'Kata Sandi Relayhost';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Batasan Ukuran Mailbox';
$wb['message_size_limit_txt'] = 'Batasan Ukuran Pesan';
$wb['ip_address_txt'] = 'Alamat IP';
......
......@@ -29,6 +29,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit';
$wb['message_size_limit_txt'] = 'Message Size Limit';
$wb['ip_address_txt'] = 'Indirizzo IP';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'リレーホスト';
$wb['relayhost_user_txt'] = 'リレーホストユーザー';
$wb['relayhost_password_txt'] = 'リレーホストパスワード';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'メールボックスのサイズ';
$wb['message_size_limit_txt'] = 'メッセージの最大サイズ';
$wb['ip_address_txt'] = 'IPアドレス';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost gebruiker';
$wb['relayhost_password_txt'] = 'Relayhost wachtwoord';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mailbox grootte limiet';
$wb['message_size_limit_txt'] = 'Message grootte limiet';
$wb['ip_address_txt'] = 'IP adres';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Adres Relayhost';
$wb['relayhost_user_txt'] = 'Użytkownik Relayhost';
$wb['relayhost_password_txt'] = 'Hasło Relayhost';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Maksymalna wielkość skrzynki pocztowej';
$wb['message_size_limit_txt'] = 'Maksymalna wielkość wiadomości';
$wb['ip_address_txt'] = 'Adres IP';
......
......@@ -31,6 +31,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Host Relay';
$wb['relayhost_user_txt'] = 'Utilizador do Host Relay';
$wb['relayhost_password_txt'] = 'Senha do Host Relay';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Tamanho máximo da Caixa Postal';
$wb['message_size_limit_txt'] = 'Tamanho máximo de mensagem';
$wb['ip_address_txt'] = 'Endereço IP';
......
......@@ -31,6 +31,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit';
$wb['message_size_limit_txt'] = 'Message Size Limit';
$wb['ip_address_txt'] = 'IP Address';
......
......@@ -29,6 +29,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relay-хост';
$wb['relayhost_user_txt'] = 'Логин Relay-хоста';
$wb['relayhost_password_txt'] = 'Пароль Relay-хоста';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Лимит размера Mailbox';
$wb['message_size_limit_txt'] = 'Лимит размера сообщения';
$wb['ip_address_txt'] = 'IP-адрес';
......
......@@ -30,6 +30,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost User';
$wb['relayhost_password_txt'] = 'Relayhost Password';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mailbox Size Limit';
$wb['message_size_limit_txt'] = 'Message Size Limit';
$wb['ip_address_txt'] = 'IP Address';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost uživateľ';
$wb['relayhost_password_txt'] = 'Relayhost heslo';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Limit ve?kosti poštovej schránky';
$wb['message_size_limit_txt'] = 'Limit ve?kosti správy';
$wb['ip_address_txt'] = 'IP Adresa';
......
......@@ -32,6 +32,7 @@ $wb['mailbox_virtual_uidgid_maps_error_alreadyusers'] = 'Uid-mapping cannot be c
$wb['relayhost_txt'] = 'Relayhost';
$wb['relayhost_user_txt'] = 'Relayhost Kullanıcı';
$wb['relayhost_password_txt'] = 'Relayhost Şifre';
$wb['reject_sender_login_mismatch_txt'] = 'Reject sender and login mismatch';
$wb['mailbox_size_limit_txt'] = 'Mail kutusu boyutu';
$wb['message_size_limit_txt'] = 'Mesaj boyutu';
$wb['ip_address_txt'] = 'IP Adresleri';
......
......@@ -65,6 +65,12 @@
<div class="form-group">
<label for="relayhost_password" class="col-sm-3 control-label">{tmpl_var name='relayhost_password_txt'}</label>
<div class="col-sm-9"><input type="password" name="relayhost_password" id="relayhost_password" value="{tmpl_var name='relayhost_password'}" autocomplete="off" class="form-control" autocomplete="off" /></div></div>
<div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='reject_sender_login_mismatch_txt'}</label>
<div class="col-sm-9">
{tmpl_var name='reject_sender_login_mismatch'}
</div>
</div>
<div class="form-group">
<label for="mailbox_size_limit" class="col-sm-3 control-label">{tmpl_var name='mailbox_size_limit_txt'}</label>
<div class="col-sm-6"><input type="text" name="mailbox_size_limit" id="mailbox_size_limit" value="{tmpl_var name='mailbox_size_limit'}" class="form-control" /></div><div class="col-sm-3 input-sm">&nbsp;MB
......
......@@ -130,67 +130,74 @@ class mail_plugin {
$app->log('Created Directory: '.$base_path, LOGLEVEL_DEBUG);
}
// Dovecot uses a different mail layout with a separate 'Maildir' subdirectory.
// Dovecot can create its Maildir on its own and can create the correct mailbox-format-type
if($mail_config['pop3_imap_daemon'] == 'dovecot') {
//exec("su -c 'mkdir -p ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
$app->system->mkdirpath($maildomain_path, 0700, $user, $group);
$app->log('Created Directory: '.$maildomain_path, LOGLEVEL_DEBUG);
$maildomain_path .= '/Maildir';
exec("su -c 'doveadm mailbox create -u \"".$data["new"]["email"]."\" INBOX'");
exec("su -c 'doveadm mailbox create -u \"".$data["new"]["email"]."\" Sent'");
exec("su -c 'doveadm mailbox create -u \"".$data["new"]["email"]."\" Trash'");
exec("su -c 'doveadm mailbox create -u \"".$data["new"]["email"]."\" Junk'");
exec("su -c 'doveadm mailbox create -u \"".$data["new"]["email"]."\" Drafts'");
exec("su -c 'doveadm mailbox subscribe -u \"".$data["new"]["email"]."\" INBOX'");
exec("su -c 'doveadm mailbox subscribe -u \"".$data["new"]["email"]."\" Sent'");
exec("su -c 'doveadm mailbox subscribe -u \"".$data["new"]["email"]."\" Trash'");
exec("su -c 'doveadm mailbox subscribe -u \"".$data["new"]["email"]."\" Junk'");
exec("su -c 'doveadm mailbox subscribe -u \"".$data["new"]["email"]."\" Drafts'");
}
//* When the mail user dir exists but it is not a valid maildir, move it to corrupted maildir folder
if(!empty($maildomain_path) && is_dir($maildomain_path) && !is_dir($maildomain_path.'/new') && !is_dir($maildomain_path.'/cur')) {
if(!is_dir($mail_config['homedir_path'].'/corrupted/'.$data['new']['mailuser_id'])) $app->system->mkdirpath($mail_config['homedir_path'].'/corrupted/'.$data['new']['mailuser_id'], 0700, $mail_config['mailuser_name'], $mail_config['mailuser_group']);
exec("su -c 'mv -f ".escapeshellcmd($data['new']['maildir'])." ".$mail_config['homedir_path'].'/corrupted/'.$data['new']['mailuser_id']."' vmail");
$app->log('Moved invalid maildir to corrupted Maildirs folder: '.escapeshellcmd($data['new']['maildir']), LOGLEVEL_WARN);
}
//* Create the maildir, if it doesn not exist, set permissions, set quota.
if(!empty($maildomain_path) && !is_dir($maildomain_path)) {
//exec("su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
$app->system->maildirmake($maildomain_path, $user, '', $group);
//* This is to fix the maildrop quota not being rebuilt after the quota is changed.
if($mail_config['pop3_imap_daemon'] != 'dovecot') {
if(is_dir($maildomain_path)) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user); // Avoid maildirmake quota bug, see debian bug #214911
$app->log('Created Maildir: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user, LOGLEVEL_DEBUG);
else {
//* When the mail user dir exists but it is not a valid maildir, move it to corrupted maildir folder
if(!empty($maildomain_path) && is_dir($maildomain_path) && !is_dir($maildomain_path.'/new') && !is_dir($maildomain_path.'/cur')) {
if(!is_dir($mail_config['homedir_path'].'/corrupted/'.$data['new']['mailuser_id'])) $app->system->mkdirpath($mail_config['homedir_path'].'/corrupted/'.$data['new']['mailuser_id'], 0700, $mail_config['mailuser_name'], $mail_config['mailuser_group']);
exec("su -c 'mv -f ".escapeshellcmd($data['new']['maildir'])." ".$mail_config['homedir_path'].'/corrupted/'.$data['new']['mailuser_id']."' vmail");
$app->log('Moved invalid maildir to corrupted Maildirs folder: '.escapeshellcmd($data['new']['maildir']), LOGLEVEL_WARN);
}
}
if(!is_dir($data['new']['maildir'].'/.Sent')) {
//exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Sent', $group);
}
if(!is_dir($data['new']['maildir'].'/.Drafts')) {
//exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Drafts', $group);
}
if(!is_dir($data['new']['maildir'].'/.Trash')) {
//exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Trash', $group);
}
if(!is_dir($data['new']['maildir'].'/.Junk')) {
//exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Junk', $group);
}
// Set permissions now recursive
exec('chown -R '.$user.':'.$group.' '.escapeshellcmd($data['new']['maildir']));
$app->log('Set ownership on '.escapeshellcmd($data['new']['maildir']), LOGLEVEL_DEBUG);
//* Set the maildir quota
if(is_dir($data['new']['maildir'].'/new') && $mail_config['pop3_imap_daemon'] != 'dovecot') {
if($data['new']['quota'] > 0) {
if(is_dir($data['new']['maildir'])) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user);
$app->log('Set Maildir quota: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user, LOGLEVEL_DEBUG);
//* Create the maildir, if it doesn not exist, set permissions, set quota.
if(!empty($maildomain_path) && !is_dir($maildomain_path)) {
//exec("su -c 'maildirmake ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
$app->system->maildirmake($maildomain_path, $user, '', $group);
//* This is to fix the maildrop quota not being rebuilt after the quota is changed.
if($mail_config['pop3_imap_daemon'] != 'dovecot') {
if(is_dir($maildomain_path)) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user); // Avoid maildirmake quota bug, see debian bug #214911
$app->log('Created Maildir: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($maildomain_path)."' ".$user, LOGLEVEL_DEBUG);
}
}
if(!is_dir($data['new']['maildir'].'/.Sent')) {
//exec("su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Sent: '."su -c 'maildirmake -f Sent ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Sent', $group);
}
if(!is_dir($data['new']['maildir'].'/.Drafts')) {
//exec("su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Drafts: '."su -c 'maildirmake -f Drafts ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Drafts', $group);
}
if(!is_dir($data['new']['maildir'].'/.Trash')) {
//exec("su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Trash: '."su -c 'maildirmake -f Trash ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Trash', $group);
}
if(!is_dir($data['new']['maildir'].'/.Junk')) {
//exec("su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name']);
//$app->log('Created submaildir Junk: '."su -c 'maildirmake -f Junk ".escapeshellcmd($maildomain_path)."' ".$mail_config['mailuser_name'],LOGLEVEL_DEBUG);
$app->system->maildirmake($maildomain_path, $user, 'Junk', $group);
}
// Set permissions now recursive
exec('chown -R '.$user.':'.$group.' '.escapeshellcmd($data['new']['maildir']));
$app->log('Set ownership on '.escapeshellcmd($data['new']['maildir']), LOGLEVEL_DEBUG);
//* Set the maildir quota
if(is_dir($data['new']['maildir'].'/new') && $mail_config['pop3_imap_daemon'] != 'dovecot') {
if($data['new']['quota'] > 0) {
if(is_dir($data['new']['maildir'])) exec("su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user);
$app->log('Set Maildir quota: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".escapeshellcmd($data['new']['maildir'])."' ".$user, LOGLEVEL_DEBUG);
}
}
}
//* Send the welcome email message
if(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt')) {
......
......@@ -138,6 +138,23 @@ class postfix_server_plugin {
exec("postconf -e 'smtpd_recipient_restrictions = ".implode(", ", $new_options)."'");
}
if($mail_config['reject_sender_login_mismatch'] != $old_ini_data['mail']['reject_sender_login_mismatch']) {
$options = explode(", ", exec("postconf -h smtpd_sender_restrictions"));
foreach ($options as $key => $value) {
if (!preg_math('/reject_authenticated_sender_login_mismatch/', $value)) {
$new_options[] = $value;
}
}
if ($mail_config['reject_sender_login_mismatch'] == 'y') {
reset($new_options); $i = 0;
// insert after check_sender_access but before permit_...