2016-05-19 06:51:20 -05:00
<!DOCTYPE html>
2015-12-14 22:56:35 -06:00
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > SQL: User mail forwarding< / title >
< link rel = "stylesheet" type = "text/css" href = "./css/markdown.css" / >
< / head >
< body >
2019-07-13 06:21:55 -05:00
2015-12-14 22:56:35 -06:00
< div id = "navigation" >
2017-11-16 21:48:44 -06:00
< a href = "https://www.iredmail.org" target = "_blank" >
2016-04-19 12:48:51 -05:00
< img alt = "iRedMail web site"
src="./images/logo-iredmail.png"
style="vertical-align: middle; height: 30px;"
/>
< span > iRedMail< / span >
< / a >
2016-02-29 02:15:19 -06:00
// < a href = "./index.html" > Document Index< / a > < / div > < h1 id = "sql-user-mail-forwarding" > SQL: User mail forwarding< / h1 >
2015-12-14 22:56:35 -06:00
< div class = "toc" >
< ul >
< li > < a href = "#sql-user-mail-forwarding" > SQL: User mail forwarding< / a > < ul >
< li > < a href = "#set-mail-forwarding-with-iredadmin-pro" > Set mail forwarding with iRedAdmin-Pro< / a > < / li >
< li > < a href = "#set-mail-forwarding-with-sql-command-line" > Set mail forwarding with SQL command line< / a > < / li >
2015-12-14 23:03:51 -06:00
< li > < a href = "#related-tutorial" > Related tutorial< / a > < / li >
2015-12-14 22:56:35 -06:00
< / ul >
< / li >
< / ul >
< / div >
2017-08-09 05:46:04 -05:00
< div class = "admonition attention" >
< p class = "admonition-title" > Attention< / p >
< ul >
< li > This document is applicable to iRedMail-0.9.7 and later releases.< / li >
< li > Here's < a href = "./sql.user.mail.forwarding-20170701.html" > doc for iRedMail-0.9.6 and earlier releases< / a > .< / li >
< / ul >
< / div >
2015-12-14 22:56:35 -06:00
< h2 id = "set-mail-forwarding-with-iredadmin-pro" > Set mail forwarding with iRedAdmin-Pro< / h2 >
< p > With iRedAdmin-Pro, you can manage mail forwarding addresses in user
profile page, under tab < code > Forwarding< / code > .< / p >
< p > Screenshot:< / p >
2017-10-28 00:38:13 -05:00
< p > < img alt = "" src = "./images/iredadmin/user_profile_mail_forwarding.png" width = "1000px" / > < / p >
2015-12-14 22:56:35 -06:00
< h2 id = "set-mail-forwarding-with-sql-command-line" > Set mail forwarding with SQL command line< / h2 >
2017-08-09 05:46:04 -05:00
< p > Let's say you have an < strong > existing< / strong > mail user < code > user@domain.com< / code > , and you want to
2015-12-14 22:56:35 -06:00
forward all received emails to another address < code > forward@example.com< / code > ,
to achieve this, you can login to SQL server and update < code > vmail< / code > database like
below:< / p >
2017-08-09 05:46:04 -05:00
< pre > < code > USE vmail;
2019-05-16 11:36:10 -05:00
INSERT INTO forwardings (address,
forwarding,
domain,
dest_domain,
is_forwarding,
active)
VALUES ('user@domain.com',
'forward@example.com',
'domain.com',
'example.com',
1,
1);
2015-12-14 22:56:35 -06:00
< / code > < / pre >
2017-08-09 05:46:04 -05:00
< p > If you want to forward email to multiple addresses, please create more records
like above:< / p >
< pre > < code > USE vmail;
-- Forwarding to address 'forward-2@example.com'
2019-05-16 11:36:10 -05:00
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);
2017-08-09 05:46:04 -05:00
-- Forwarding to address 'forward-3@example.com'
2019-05-16 11:36:10 -05:00
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);
2015-12-14 22:56:35 -06:00
< / code > < / pre >
< p > To save a copy of forwarded email in mailbox, please add your own email address
as a forwarding destination like below:< / p >
2018-01-24 04:32:06 -06:00
< div class = "admonition attention" >
< p class = "admonition-title" > Attention< / p >
< p > This SQL record exists by default, but it's a good idea to make sure it
exists. If it exists, you will get error like < code > ERROR 1062
(23000): Duplicate entry 'user@domain.com-user@domain.com' for key
'address'< / code > , don't panic.< / p >
< / div >
2019-05-16 11:36:10 -05:00
< pre > < code > INSERT INTO forwardings (address,
forwarding,
domain,
dest_domain,
is_forwarding,
active)
VALUES ('user@domain.com',
'user@domain.com',
'domain.com',
'domain.com',
1,
1);
2015-12-14 23:03:51 -06:00
< / code > < / pre >
< h2 id = "related-tutorial" > Related tutorial< / h2 >
< ul >
< li > < a href = "./ldap.user.mail.forwarding.html" > LDAP: user mail forwarding< / a > < / li >
2016-05-19 06:51:20 -05:00
< / ul > < div class = "footer" >
2019-09-06 00:54:43 -05:00
< p style = "text-align: center; color: grey;" > All documents are available in < a href = "https://github.com/iredmail/docs/" > BitBucket repository< / a > , and published under < a href = "http://creativecommons.org/licenses/by-nd/3.0/us/" target = "_blank" > Creative Commons< / a > license. You can < a href = "https://github.com/iredmail/docs/archive/master.zip" > download the latest version< / a > for offline reading. If you found something wrong, please do < a href = "https://www.iredmail.org/contact.html" > contact us< / a > to fix it.< / p >
2016-05-19 06:51:20 -05:00
< / div >
2017-11-05 02:33:58 -06:00
<!-- Global site tag (gtag.js) - Google Analytics -->
< script async src = "https://www.googletagmanager.com/gtag/js?id=UA-3293801-21" > < / script >
< script >
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
2015-12-14 22:56:35 -06:00
2017-11-05 02:33:58 -06:00
gtag('config', 'UA-3293801-21');
2015-12-14 22:56:35 -06:00
< / script >
< / body > < / html >