Skip to content

Commit 0e2978e

Browse files
committed
Mailbox quota can now be included into website quota (FS#3297)
-------------------------------------------------------------- Feature can be activated over admin mailserver settings. when activated websites uid is used instead of standard vmail-uid. this only takes effect if web and mailserver are on the same server, otherwise it will be old behaviour. switching this setting when mailboxes exist doesn't matter. Mailboxfolder will be created with website uid for this. access of postfix and dovecot now works over mysql-table mail_user. virtual_uid_maps is changed from static to mysql-table. for dovecot<->postfix communication protocoll is changed vrom lda to lmtp. disablelmtp-column is added to mail_user-table. uid and gid can be overwritten by remoting. ONE OPEN ISSUE: since remoting has completly changed and mail_user_add function is missing at the moment, this function now was inclulded again. it is important to add the both new lines to the future function and then remove this new one.
1 parent d73810d commit 0e2978e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+273
-55
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `mail_user` ADD `disablelmtp` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n' AFTER `disablelda` ;

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ CREATE TABLE `mail_user` (
884884
`disablesmtp` enum('n','y') NOT NULL default 'n',
885885
`disablesieve` enum('n','y') NOT NULL default 'n',
886886
`disablelda` enum('n','y') NOT NULL default 'n',
887+
`disablelmtp` enum('n','y') NOT NULL default 'n',
887888
`disabledoveadm` enum('n','y') NOT NULL default 'n',
888889
`last_quota_notification` date NULL default NULL,
889890
`backup_interval` VARCHAR( 255 ) NOT NULL,

install/tpl/debian6_dovecot2.conf.master

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
listen = *,[::]
2-
protocols = imap pop3
2+
protocols = imap pop3 lmtp
33
auth_mechanisms = plain login
44
disable_plaintext_auth = no
55
log_timestamp = "%Y-%m-%d %H:%M:%S "
@@ -31,6 +31,13 @@ service auth {
3131
}
3232
user = root
3333
}
34+
service lmtp {
35+
unix_listener /var/spool/postfix/private/dovecot-lmtp {
36+
group = postfix
37+
mode = 0600
38+
user = postfix
39+
}
40+
}
3441
service imap-login {
3542
client_limit = 1000
3643
process_limit = 500
@@ -44,4 +51,8 @@ protocol pop3 {
4451
}
4552
protocol lda {
4653
mail_plugins = sieve quota
54+
}
55+
protocol lmtp {
56+
postmaster_address = webmaster@localhost
57+
mail_plugins = quota sieve
4758
}

install/tpl/debian_dovecot2.conf.master

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
listen = *,[::]
2-
protocols = imap pop3
2+
protocols = imap pop3 lmtp
33
auth_mechanisms = plain login
44
disable_plaintext_auth = no
55
log_timestamp = "%Y-%m-%d %H:%M:%S "
@@ -31,6 +31,13 @@ service auth {
3131
}
3232
user = root
3333
}
34+
service lmtp {
35+
unix_listener /var/spool/postfix/private/dovecot-lmtp {
36+
group = postfix
37+
mode = 0600
38+
user = postfix
39+
}
40+
}
3441
service imap-login {
3542
client_limit = 1000
3643
process_limit = 500
@@ -44,4 +51,8 @@ protocol pop3 {
4451
}
4552
protocol lda {
4653
mail_plugins = sieve quota
54+
}
55+
protocol lmtp {
56+
postmaster_address = webmaster@localhost
57+
mail_plugins = quota sieve
4758
}

install/tpl/debian_postfix.conf.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, prox
55
virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf
66
virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf
77
virtual_mailbox_base = {vmail_mailbox_base}
8-
virtual_uid_maps = static:{vmail_userid}
9-
virtual_gid_maps = static:{vmail_groupid}
8+
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual_uids.cf
9+
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
1010
inet_protocols=all
1111
smtpd_sasl_auth_enable = yes
1212
broken_sasl_auth_clients = yes
@@ -25,7 +25,7 @@ smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual
2525
smtpd_client_message_rate_limit = 100
2626
maildrop_destination_concurrency_limit = 1
2727
maildrop_destination_recipient_limit = 1
28-
virtual_transport = maildrop
28+
virtual_transport = lmtp:unix:private/dovecot-lmtp
2929
header_checks = regexp:{config_dir}/header_checks
3030
mime_header_checks = regexp:{config_dir}/mime_header_checks
3131
nested_header_checks = regexp:{config_dir}/nested_header_checks

install/tpl/fedora_dovecot2.conf.master

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
listen = *,[::]
2-
protocols = imap pop3
2+
protocols = imap pop3 lmtp
33
auth_mechanisms = plain login
44
disable_plaintext_auth = no
55
log_timestamp = "%Y-%m-%d %H:%M:%S "
@@ -31,6 +31,13 @@ service auth {
3131
}
3232
user = root
3333
}
34+
service lmtp {
35+
unix_listener /var/spool/postfix/private/dovecot-lmtp {
36+
group = postfix
37+
mode = 0600
38+
user = postfix
39+
}
40+
}
3441
service imap-login {
3542
client_limit = 1000
3643
process_limit = 500
@@ -44,4 +51,8 @@ protocol pop3 {
4451
}
4552
protocol lda {
4653
mail_plugins = sieve quota
54+
}
55+
protocol lmtp {
56+
postmaster_address = webmaster@localhost
57+
mail_plugins = quota sieve
4758
}

install/tpl/fedora_postfix.conf.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, prox
33
virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf
44
virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf
55
virtual_mailbox_base = {vmail_mailbox_base}
6-
virtual_uid_maps = static:{vmail_userid}
7-
virtual_gid_maps = static:{vmail_groupid}
6+
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual_uids.cf
7+
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
88
smtpd_sasl_auth_enable = yes
99
broken_sasl_auth_clients = yes
1010
smtpd_sasl_authenticated_header = yes
@@ -22,7 +22,7 @@ smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual
2222
smtpd_client_message_rate_limit = 100
2323
maildrop_destination_concurrency_limit = 1
2424
maildrop_destination_recipient_limit = 1
25-
virtual_transport = maildrop
25+
virtual_transport = lmtp:unix:private/dovecot-lmtp
2626
header_checks = regexp:{config_dir}/header_checks
2727
mime_header_checks = regexp:{config_dir}/mime_header_checks
2828
nested_header_checks = regexp:{config_dir}/nested_header_checks

install/tpl/gentoo_postfix.conf.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ virtual_alias_maps = proxy:mysql:{config_dir}/mysql-virtual_forwardings.cf, prox
33
virtual_mailbox_domains = proxy:mysql:{config_dir}/mysql-virtual_domains.cf
44
virtual_mailbox_maps = proxy:mysql:{config_dir}/mysql-virtual_mailboxes.cf
55
virtual_mailbox_base = {vmail_mailbox_base}
6-
virtual_uid_maps = static:{vmail_userid}
7-
virtual_gid_maps = static:{vmail_groupid}
6+
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual_uids.cf
7+
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
88
smtpd_sasl_auth_enable = yes
99
broken_sasl_auth_clients = yes
1010
smtpd_sasl_authenticated_header = yes
@@ -22,7 +22,7 @@ smtpd_client_restrictions = check_client_access mysql:{config_dir}/mysql-virtual
2222
smtpd_client_message_rate_limit = 100
2323
maildrop_destination_concurrency_limit = 1
2424
maildrop_destination_recipient_limit = 1
25-
virtual_transport = maildrop
25+
virtual_transport = lmtp:unix:private/dovecot-lmtp
2626
header_checks = regexp:{config_dir}/header_checks
2727
mime_header_checks = regexp:{config_dir}/mime_header_checks
2828
nested_header_checks = regexp:{config_dir}/nested_header_checks
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
user = {mysql_server_ispconfig_user}
2+
password = {mysql_server_ispconfig_password}
3+
dbname = {mysql_server_database}
4+
table = mail_user
5+
select_field = gid
6+
where_field = email
7+
additional_conditions = and postfix = 'y' and server_id = {server_id}
8+
hosts = {mysql_server_ip}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
user = {mysql_server_ispconfig_user}
2+
password = {mysql_server_ispconfig_password}
3+
dbname = {mysql_server_database}
4+
table = mail_user
5+
select_field = uid
6+
where_field = email
7+
additional_conditions = and postfix = 'y' and server_id = {server_id}
8+
hosts = {mysql_server_ip}

0 commit comments

Comments
 (0)