Topic: Problems with auto BCC for a relayed sender address
======== 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): Nginx
- Manage mail accounts with iRedAdmin-Pro? No.
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
I set up a relayed address that uses an external SMTP server as follows.
INSERT INTO sender_relayhost (account, relayhost) VALUES ('@host1.tld1', '[smtp.host1.tld1]:587');
With this I can use "'user1@host1.tld1" as FROM address from both RoundCube and Thunderbird. I then followed the instructions to set up auto BCC rules:
INSERT INTO sender_bcc_user (username, bcc_address, domain, active, created)
VALUES ('user1@host1.tld1', 'myuser+Sent@mydomain', 'host1.tld1', 1, NOW());
INSERT INTO sender_bcc_user (username, bcc_address, domain, active, created)
VALUES ('myuser@mydomain.mytld', 'myuser+Sent@mydomain.mytld', 'mydomain.mytld', 1, NOW());
However, only the second row triggers BCC for the hosted address "myuser@mydomain.mytld". The first row does nothing.
Following is something I tried while debugging the issue:
I added "host1.tld1" to the "domain" table, so that "user1@host1.tld1" can be found while looking up sender_bcc_maps:
INSERT INTO domain (domain, transport, active, created) VALUES ('host1.tld1', 'relay:[smtp.host1.tld1]:587', 1, NOW());
However, now when I tested from Thunderbird, I got an SMTP error: postfix/submission/smtpd[644]: NOQUEUE: reject: RCPT from unknown[123.45.67.89]: 550 5.1.0 <user1@host1.tld1>: Sender address rejected: User unknown in virtual mailbox table; from=<user1@host1.tld1> to=<userX@hostX.tldX> proto=ESMTP helo=<[192.168.1.100]>.
What's the correct way to set up auto BCC for a relayed address?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.