From 21b016e2a930950ca021bc4ae5242dbc6066cf5f Mon Sep 17 00:00:00 2001 From: Zhang Huangbin Date: Wed, 9 Aug 2017 18:46:04 +0800 Subject: [PATCH] Update en_US/howto/sql.user.mail.forwarding.md with new sql structure in iRedMail-0.9.7. --- .../0-sql.user.mail.forwarding-20170701.md | 47 ++++++++++++ en_US/howto/sql.user.mail.forwarding.md | 45 +++++++++-- html/sql.user.mail.forwarding-20170701.html | 75 +++++++++++++++++++ html/sql.user.mail.forwarding.html | 47 ++++++++++-- 4 files changed, 200 insertions(+), 14 deletions(-) create mode 100644 en_US/howto/0-sql.user.mail.forwarding-20170701.md create mode 100644 html/sql.user.mail.forwarding-20170701.html diff --git a/en_US/howto/0-sql.user.mail.forwarding-20170701.md b/en_US/howto/0-sql.user.mail.forwarding-20170701.md new file mode 100644 index 00000000..33dfc765 --- /dev/null +++ b/en_US/howto/0-sql.user.mail.forwarding-20170701.md @@ -0,0 +1,47 @@ +# SQL: User mail forwarding + +[TOC] + +!!! attention + + * This document is applicable to iRedMail-0.9.6 and earlier releases. + * Here's [doc for iRedMail-0.9.7 and later releases](./sql.user.mail.forwarding.html). + +## Set mail forwarding with iRedAdmin-Pro + +With iRedAdmin-Pro, you can manage mail forwarding addresses in user +profile page, under tab `Forwarding`. + +Screenshot: + +![](../images/iredadmin/user_profile_mail_forwarding.png){: width=1000px } + +## Set mail forwarding with SQL command line + +Let's say you have an existing mail user `user@domain.com`, and you want to +forward all received emails to another address `forward@example.com`, +to achieve this, you can login to SQL server and update `vmail` database like +below: + +``` +sql> USE vmail; +sql> UPDATE alias SET goto='forward@example.com' WHERE address='user@domain.com'; +``` + +If you want to forward email to multiple destinations, please separate +addresses with comma like below: + +``` +sql> UPDATE alias SET goto='forward_1@example.com,forward_2@example.com,forward_3@example.com' WHERE address='user@domain.com'; +``` + +To save a copy of forwarded email in mailbox, please add your own email address +as a forwarding destination like below: + +``` +sql> UPDATE alias SET goto='user@domain.com,forward_1@example.com' WHERE address='user@domain.com'; +``` + +## Related tutorial + +* [LDAP: user mail forwarding](./ldap.user.mail.forwarding.html) diff --git a/en_US/howto/sql.user.mail.forwarding.md b/en_US/howto/sql.user.mail.forwarding.md index 7ec76d22..ec23452c 100644 --- a/en_US/howto/sql.user.mail.forwarding.md +++ b/en_US/howto/sql.user.mail.forwarding.md @@ -2,6 +2,11 @@ [TOC] +!!! attention + + * This document is applicable to iRedMail-0.9.7 and later releases. + * Here's [doc for iRedMail-0.9.6 and earlier releases](./sql.user.mail.forwarding-20170701.html). + ## Set mail forwarding with iRedAdmin-Pro With iRedAdmin-Pro, you can manage mail forwarding addresses in user @@ -13,28 +18,54 @@ Screenshot: ## Set mail forwarding with SQL command line -Let's say you have an existing mail user `user@domain.com`, and you want to +Let's say you have an __existing__ mail user `user@domain.com`, and you want to forward all received emails to another address `forward@example.com`, to achieve this, you can login to SQL server and update `vmail` database like below: ``` -sql> USE vmail; -sql> UPDATE alias SET goto='forward@example.com' WHERE address='user@domain.com'; +USE vmail; +INSERT INTO forwardings (address, forwarding, + domain, dest_domain, + is_forwarding, active) + VALUES ('user@domain.com', 'forward@example.com', + 'domain.com', 'example.com', + 1, 1); ``` -If you want to forward email to multiple destinations, please separate -addresses with comma like below: +If you want to forward email to multiple addresses, please create more records +like above: ``` -sql> UPDATE alias SET goto='forward_1@example.com,forward_2@example.com,forward_3@example.com' WHERE address='user@domain.com'; +USE vmail; + +-- Forwarding to address 'forward-2@example.com' +INSERT INTO forwardings (address, forwarding, + domain, dest_domain, + is_forwarding, active) + VALUES ('user@domain.com', 'forward-2@example.com', + 'domain.com', 'example.com', + 1, 1); + +-- Forwarding to address 'forward-3@example.com' +INSERT INTO forwardings (address, forwarding, + domain, dest_domain, + is_forwarding, active) + VALUES ('user@domain.com', 'forward-3@example.com', + 'domain.com', 'example.com', + 1, 1); ``` To save a copy of forwarded email in mailbox, please add your own email address as a forwarding destination like below: ``` -sql> UPDATE alias SET goto='user@domain.com,forward_1@example.com' WHERE address='user@domain.com'; +INSERT INTO forwardings (address, forwarding, + domain, dest_domain, + is_forwarding, active) + VALUES ('user@domain.com', 'user@domain.com', + 'domain.com', 'domain.com', + 1, 1); ``` ## Related tutorial diff --git a/html/sql.user.mail.forwarding-20170701.html b/html/sql.user.mail.forwarding-20170701.html new file mode 100644 index 00000000..1f184879 --- /dev/null +++ b/html/sql.user.mail.forwarding-20170701.html @@ -0,0 +1,75 @@ + + + + + SQL: User mail forwarding + + + + +

SQL: User mail forwarding

+
+ +
+
+

Attention

+ +
+

Set mail forwarding with iRedAdmin-Pro

+

With iRedAdmin-Pro, you can manage mail forwarding addresses in user +profile page, under tab Forwarding.

+

Screenshot:

+

+

Set mail forwarding with SQL command line

+

Let's say you have an existing mail user user@domain.com, and you want to +forward all received emails to another address forward@example.com, +to achieve this, you can login to SQL server and update vmail database like +below:

+
sql> USE vmail;
+sql> UPDATE alias SET goto='forward@example.com' WHERE address='user@domain.com';
+
+ +

If you want to forward email to multiple destinations, please separate +addresses with comma like below:

+
sql> UPDATE alias SET goto='forward_1@example.com,forward_2@example.com,forward_3@example.com' WHERE address='user@domain.com';
+
+ +

To save a copy of forwarded email in mailbox, please add your own email address +as a forwarding destination like below:

+
sql> UPDATE alias SET goto='user@domain.com,forward_1@example.com' WHERE address='user@domain.com';
+
+ + + + + \ No newline at end of file diff --git a/html/sql.user.mail.forwarding.html b/html/sql.user.mail.forwarding.html index 15cd08ce..3b1a5fbd 100644 --- a/html/sql.user.mail.forwarding.html +++ b/html/sql.user.mail.forwarding.html @@ -26,28 +26,61 @@ +
+

Attention

+ +

Set mail forwarding with iRedAdmin-Pro

With iRedAdmin-Pro, you can manage mail forwarding addresses in user profile page, under tab Forwarding.

Screenshot:

Set mail forwarding with SQL command line

-

Let's say you have an existing mail user user@domain.com, and you want to +

Let's say you have an existing mail user user@domain.com, and you want to forward all received emails to another address forward@example.com, to achieve this, you can login to SQL server and update vmail database like below:

-
sql> USE vmail;
-sql> UPDATE alias SET goto='forward@example.com' WHERE address='user@domain.com';
+
USE vmail;
+INSERT INTO forwardings (address, forwarding,
+                         domain, dest_domain,
+                         is_forwarding, active)
+                 VALUES ('user@domain.com', 'forward@example.com',
+                         'domain.com', 'example.com',
+                         1, 1);
 
-

If you want to forward email to multiple destinations, please separate -addresses with comma like below:

-
sql> UPDATE alias SET goto='forward_1@example.com,forward_2@example.com,forward_3@example.com' WHERE address='user@domain.com';
+

If you want to forward email to multiple addresses, please create more records +like above:

+
USE vmail;
+
+-- Forwarding to address 'forward-2@example.com'
+INSERT INTO forwardings (address, forwarding,
+                         domain, dest_domain,
+                         is_forwarding, active)
+                 VALUES ('user@domain.com', 'forward-2@example.com',
+                         'domain.com', 'example.com',
+                         1, 1);
+
+-- Forwarding to address 'forward-3@example.com'
+INSERT INTO forwardings (address, forwarding,
+                         domain, dest_domain,
+                         is_forwarding, active)
+                 VALUES ('user@domain.com', 'forward-3@example.com',
+                         'domain.com', 'example.com',
+                         1, 1);
 

To save a copy of forwarded email in mailbox, please add your own email address as a forwarding destination like below:

-
sql> UPDATE alias SET goto='user@domain.com,forward_1@example.com' WHERE address='user@domain.com';
+
INSERT INTO forwardings (address, forwarding,
+                         domain, dest_domain,
+                         is_forwarding, active)
+                 VALUES ('user@domain.com', 'user@domain.com',
+                         'domain.com', 'domain.com',
+                         1, 1);