Topic: Trouble with Auto Forwarding via SQL
==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
I have a user who wants all of his emails forwarded (and kept) to another email account I'm not hosting.
I followed the SQL tutorial and used the command:
INSERT INTO forwardings (address, forwarding, domain, dest_domain, is_forwarding, active) VALUES ('him@myhosting.com', 'him@somewhereelse.com', 'myhosting.com', 'somewhereelse.com', 1, 1);
followed by a second, similar command to KEEP the emails, per the directions:
INSERT INTO forwardings (address, forwarding, domain, dest_domain, is_forwarding, active) VALUES ('him@myhosting.com', 'him@myhosting.com', 'myhosting.com', 'myhosting.com', 1, 1);
on the second command, however, I get the error:
ERROR 1062 (23000): Duplicate entry 'him@myhosting.com-him@myhosting.com' for key 'address'
after this error I typed QUIT to get out (not sure if this commits the changes or threw them away).
So:
1. What do I do about the error?
2. Are my changes committed and his emails now ONLY go to the him@somewhereelse.com address?
Andrew
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.