Skip to content
Snippets Groups Projects
Commit aab989fa authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'email_forward_only_with_auth' into 'stable-3.1'

email account forward

See merge request ispconfig/ispconfig3!1009
parents 94be0a2a ca9fab3d
No related branches found
No related tags found
No related merge requests found
Showing
with 88 additions and 81 deletions
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_access
select_field = access
where_field = source
additional_conditions = and type = 'client' and active = 'y'
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select access from mail_access where source = '%s' and type = 'client' and active = 'y'
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_domain
select_field = domain
where_field = domain
additional_conditions = and active = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select domain from mail_domain where domain = '%s' and active = 'y' and server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = email
where_field = email
additional_conditions = and postfix = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = SELECT email FROM mail_user WHERE email = '%s' AND postfix = 'y' AND disabledeliver = 'n' AND server_id = {server_id}
UNION
SELECT cc AS email FROM mail_user WHERE email = '%s' AND postfix = 'y' AND disabledeliver = 'y' AND server_id = {server_id}
......@@ -2,4 +2,22 @@ user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
hosts = {mysql_server_ip}
query = SELECT u.email as target FROM mail_forwarding as s INNER JOIN mail_user as u ON (u.email = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1))) WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND u.disabledeliver = 'n' AND s.server_id = {server_id} UNION SELECT s.destination as target FROM mail_forwarding as s WHERE s.source = '%s' AND s.type IN ('alias', 'forward') and s.active = 'y' AND s.server_id = {server_id} UNION SELECT s.destination as target FROM mail_forwarding as s INNER JOIN mail_forwarding as f ON (f.source = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1))) WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND f.active = 'y' AND s.server_id = {server_id} UNION SELECT s.destination as target FROM mail_forwarding as s WHERE s.source = '@%d' AND s.type IN ('catchall') and s.active = 'y' AND s.server_id = {server_id} UNION SELECT s.destination as target FROM mail_forwarding as s INNER JOIN mail_forwarding as t ON (t.source = s.destination AND t.type = 'catchall') WHERE s.source = '@%d' AND s.type = 'aliasdomain' and s.active = 'y' AND t.active = 'y' AND s.server_id = {server_id}
query = SELECT u.email as target FROM mail_forwarding as s
INNER JOIN mail_user as u ON (u.email = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1)))
WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND u.disabledeliver = 'n' AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
WHERE s.source = '%s' AND s.type IN ('alias', 'forward') and s.active = 'y' AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
INNER JOIN mail_forwarding as f ON (f.source = CONCAT('%u@', SUBSTRING_INDEX(s.destination,'@',-1)))
WHERE s.source = '@%d' AND s.type = 'aliasdomain' AND s.active = 'y' AND f.active = 'y' AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
LEFT JOIN mail_user as uu ON (uu.email = '%s' AND uu.disabledeliver = 'n')
LEFT JOIN mail_forwarding as uf ON (uf.source = '%s' AND uf.type IN ('alias', 'forward') AND uf.active = 'y')
WHERE s.source = '@%d' AND s.type IN ('catchall') and s.active = 'y' AND uu.mailuser_id IS NULL AND uf.forwarding_id IS NULL AND s.server_id = {server_id}
UNION
SELECT s.destination as target FROM mail_forwarding as s
INNER JOIN mail_forwarding as t ON (t.source = s.destination AND t.type = 'catchall')
WHERE s.source = '@%d' AND s.type = 'aliasdomain' and s.active = 'y' AND t.active = 'y' AND s.server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = gid
where_field = email
additional_conditions = and postfix = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select gid from mail_user where email = '%s' and postfix = 'y' and server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
where_field = login
additional_conditions = and postfix = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
query = select CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') from mail_user where login = '%s' and postfix = 'y' and server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = sender_cc
where_field = email
additional_conditions = and postfix = 'y' and disabledeliver = 'n' and disables$
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = sender_cc
where_field = email
additional_conditions = and postfix = 'y' and disabledeliver = 'n' and disablesmtp = 'n' and sender_cc != ''
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = SELECT sender_cc FROM (
SELECT SUBSTRING_INDEX(sender_cc, ',', 1) AS sender_cc
FROM mail_user WHERE email = '%s' AND disablesmtp = 'n' AND sender_cc != '' AND server_id = {server_id}
UNION
SELECT SUBSTRING_INDEX(u.sender_cc, ',', 1) AS sender_cc
FROM mail_user u, mail_forwarding f
WHERE f.destination REGEXP CONCAT( '((^|\\n)[[:blank:]]*,?|[[:alnum:]][[:blank:]]*,)[[:blank:]]*',
REPLACE( REPLACE(u.email, '+', '\\+'), '.', '\\.' ),
'[[:blank:]]*(,[[:blank:]]*[[:alnum:]]|,?[[:blank:]]*(\\r?\\n|$))' )
AND u.disablesmtp = 'n' AND u.sender_cc != '' AND u.server_id = {server_id}
AND f.source = '%s' AND f.allow_send_as = 'y' AND f.active = 'y' AND f.server_id = {server_id}
) table1 WHERE sender_cc != '' LIMIT 1
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
hosts = {mysql_server_ip}
query = SELECT 'greylisting' FROM
(SELECT `greylisting`, 1 as `prio` FROM `mail_user` WHERE `server_id` = {server_id} AND `email` = '%s'
UNION SELECT `greylisting`, 2 as `prio` FROM `mail_forwarding` WHERE `server_id` = {server_id} AND `source` = '%s'
UNION SELECT `greylisting`, 3 as `prio` FROM `mail_forwarding` WHERE `server_id` = {server_id} AND `source` = '@%d' ORDER BY `prio` ASC LIMIT 1) as rules
(
SELECT `greylisting`, 1 as `prio` FROM `mail_user` WHERE `server_id` = {server_id} AND `email` = '%s'
UNION
SELECT `greylisting`, 2 as `prio` FROM `mail_forwarding` WHERE `server_id` = {server_id} AND `source` = '%s'
UNION
SELECT `greylisting`, 3 as `prio` FROM `mail_forwarding` WHERE `server_id` = {server_id} AND `source` = '@%d' ORDER BY `prio` ASC LIMIT 1
) AS rules
WHERE rules.greylisting = 'y'
hosts = {mysql_server_ip}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_access
select_field = access
where_field = source
additional_conditions = and type = 'recipient' and active = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select access from mail_access where source = '%s' and type = 'recipient' and active = 'y' and server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_transport
select_field = domain
where_field = domain
additional_conditions = and active = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select domain from mail_transport where domain = '%s' and active = 'y' and server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_relay_recipient
select_field = access
where_field = source
additional_conditions = and active = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select access from mail_relay_recipient where source = '%s' and active = 'y' and server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_access
select_field = access
where_field = source
additional_conditions = and type = 'sender' and active = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select access from mail_access where source = '%s' and type = 'sender' and active = 'y' and server_id = {server_id}
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 allow_send_as = 'y' AND server_id = {server_id} 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
hosts = {mysql_server_ip}
query = SELECT destination FROM mail_forwarding WHERE source = '%s' AND active = 'y' AND allow_send_as = 'y' AND server_id = {server_id}
UNION
SELECT email FROM mail_user WHERE email = '%s' AND disablesmtp = 'n' AND server_id = {server_id};
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_transport
select_field = transport
where_field = domain
additional_conditions = and active = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
\ No newline at end of file
hosts = {mysql_server_ip}
query = select transport from mail_transport where domain = '%s' and active = 'y' and server_id = {server_id}
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = uid
where_field = email
additional_conditions = and postfix = 'y' and server_id = {server_id}
hosts = {mysql_server_ip}
query = select uid from mail_user where email = '%s' and postfix = 'y' and server_id = {server_id}
......@@ -199,14 +199,14 @@ $form["tabs"]['mailuser'] = array(
2 => array( 'event' => 'SAVE',
'type' => 'TOLOWER')
),
'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex'=>'/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,63}){0,1}(,\s*\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,63}){0,}$/i',
'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
'errmsg'=> 'sender_cc_error_isemail'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
'maxlength' => '255',
'searchable' => 2
),
'maildir' => array (
'datatype' => 'VARCHAR',
......@@ -292,6 +292,12 @@ $form["tabs"]['mailuser'] = array(
'default' => 'n',
'value' => array(1 => 'y', 0 => 'n')
),
'disabledeliver' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(1 => 'y', 0 => 'n')
),
'disableimap' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
......
......@@ -20,6 +20,7 @@ $wb['server_id_txt'] = 'Aerver_id';
$wb['password_txt'] = 'Password';
$wb['maildir_txt'] = 'Maildir';
$wb['postfix_txt'] = 'Enable Receiving';
$wb['tooltip_postfix_txt'] = 'Allows incoming mail to this address.';
$wb['greylisting_txt'] = 'Enable greylisting';
$wb['access_txt'] = 'Enable Access';
$wb['policy_txt'] = 'Spamfilter';
......@@ -56,11 +57,14 @@ $wb['weekly_backup_txt'] = 'Weekly';
$wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['disablesmtp_txt'] = 'Disable sending';
$wb['tooltip_disablesmtp_txt'] = 'Disables mail submission from this mail account.';
$wb['disabledeliver_txt'] = 'Disable (local) delivering';
$wb['tooltip_disabledeliver_txt'] = 'Disables delivery to INBOX, and processing by mail filters and sieve scripts. Mail forwards to \'Send copy to\' address.';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['sender_cc_note_txt'] = '(One email address only)';
$wb['password_click_to_set_txt'] = 'Click to set';
$wb['purge_trash_days_txt'] = 'Purge Trash automatically after X days';
$wb['tooltip_purge_trash_days_txt'] = '0 = disabled';
......
......@@ -7,6 +7,7 @@ $wb['name_txt'] = 'Realname';
$wb['login_txt'] = 'Login';
$wb['postfix_txt'] = 'Receiving';
$wb['disablesmtp_txt'] = 'SMTP (sending)';
$wb['disabledeliver_txt'] = 'INBOX';
$wb['disableimap_txt'] = 'IMAP';
$wb['disablepop3_txt'] = 'POP3';
?>
......@@ -16,6 +16,7 @@ $wb['server_id_txt'] = 'server_id';
$wb['password_txt'] = 'парола';
$wb['maildir_txt'] = 'maildir';
$wb['postfix_txt'] = 'Разреши получаване';
$wb['tooltip_postfix_txt'] = 'Allows incoming mail to this address.';
$wb['greylisting_txt'] = 'Enable greylisting';
$wb['access_txt'] = 'Разреши достъп';
$wb['policy_txt'] = 'Спам филтър';
......@@ -50,7 +51,10 @@ $wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['disablesmtp_txt'] = 'Disable sending';
$wb['tooltip_disablesmtp_txt'] = 'Disables mail submission from this mail account.';
$wb['disabledeliver_txt'] = 'Disable (local) delivering';
$wb['tooltip_disabledeliver_txt'] = 'Disables delivery to INBOX, and processing by mail filters and sieve scripts. Mail forwards to \'Send copy to\' address.';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
......@@ -60,7 +64,7 @@ $wb['no_backup_txt'] = 'No backup';
$wb['daily_backup_txt'] = 'Daily';
$wb['weekly_backup_txt'] = 'Weekly';
$wb['monthly_backup_txt'] = 'Monthly';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['sender_cc_note_txt'] = '(One email address only)';
$wb['password_click_to_set_txt'] = 'Click to set';
$wb['purge_trash_days_txt'] = 'Purge Trash automatically after X days';
$wb['tooltip_purge_trash_days_txt'] = '0 = disabled';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment