How to redirect mails from specific email to one user: Difference between revisions
(Created page with "=How to redirect emails from specific e-mail address to specific user= {{KB|{{ZC}}|{{ZCS 8.6}}|{{ZCS 8.5}}|{{ZCS 8.0}}|}} ===Resolution=== ---- In this article we will see h...") |
mNo edit summary |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
=How to redirect emails from specific e-mail address to specific user= | =How to redirect emails from specific e-mail address to a specific user= | ||
{{KB|{{ | {{KB|{{WIP}}|{{ZCS 8.7}}|{{ZCS 8.6}}|}} | ||
Line 44: | Line 44: | ||
===Additional Content=== | ===Additional Content=== | ||
---- | ---- | ||
Below are more header | |||
If you configure that on ZCS 8.6, and then upgrade to 8.7, the setting will be working without re-doing it. | |||
Below are more header checks you may want to use: | |||
/^Subject:(.*)From U.S. Ambassador to Nigeria/ DISCARD #spam rule no msgs from Nigeria | /^Subject:(.*)From U.S. Ambassador to Nigeria/ DISCARD #spam rule no msgs from Nigeria | ||
Line 64: | Line 68: | ||
{{Article Footer|Zimbra Collaboration 8. | {{Article Footer|Zimbra Collaboration 8.7, 8.6| 24/03/2017}} | ||
{{NeedSME|SME1|SME2|COPY EDITOR}} | {{NeedSME|SME1|SME2|COPY EDITOR}} |
Latest revision as of 14:01, 22 November 2023
How to redirect emails from specific e-mail address to a specific user
Resolution
In this article we will see how to redirect an email from a specific email address to a designated user. For example you have emails coming from advertisement@domain.com that are flooding your users, and you want to catch all emails from this email address, and to redirect them to a user (sysadm@domain.com) that will act as a quarantine user.
To accomplish our task, we will be using Postfix Header check, to catch and redirect the emails.
1. Go to:
cd /opt/zimbra/conf
2. Create a file for headers:
touch /opt/zimbra/conf/custom_header_checks
3. In this file add this line:
/^From:(.*)advertisement@domain.com/ REDIRECT sysadm@domain.com
4. Check the current settings:
zmprov gcf zimbraMtaHeaderChecks
5. If there are no entries you can run the following command to add the new file to the config:
zmprov mcf zimbraMtaHeaderChecks 'pcre:/opt/zimbra/conf/custom_header_checks'
If there is already a setting, you can just add the new to the old as follows:
zmprov mcf zimbraMtaHeaderChecks 'pcre:/opt/zimbra/conf/custom_header_checks_old, pcre:/opt/zimbra/conf/custom_header_checks'
6. Check if the setting is written to the config:
zmprov gcf zimbraMtaHeaderChecks postconf | grep header_checks
If not, run:
zmprov mcf zimbraMtaBlockedExtensionWarnRecipient FALSE
7. Restart mta
zmmtactl restart
Next, test if the configuration is working by sending an email from a test email.
Additional Content
If you configure that on ZCS 8.6, and then upgrade to 8.7, the setting will be working without re-doing it.
Below are more header checks you may want to use:
/^Subject:(.*)From U.S. Ambassador to Nigeria/ DISCARD #spam rule no msgs from Nigeria /^Subject:(.*)\?KOI8-R\?/ DISCARD #spam rule Russian encoding not allowed by this server /^Subject:.*Bad Word*/ REPLACE Subject: Censored /^From:(.*)Slice-O-Matic Reviews/ DISCARD #spam rule No slice o-matics /^From:(.*)Your Free iPad/ DISCARD #spam rule No thank you /^From:(.*)user005@badspammerdomain.com/ DISCARD #spam Known spammer address /^From:(.*)Tarot Reading/ DISCARD #spam rule No Tarot reading /^From:(.*)someaccount@yahoo.com/ REDIRECT ceo@domainexample.com #spam rule redirect all messages from this address /^From:(.*)<(.*)@yahoo.com>(.*)/ REDIRECT monitor@domainexample.com /^To:(.*)<(.*)@yahoo.com>(.*)/ REDIRECT monitor@domainexample.com /^Received: from .+\..+\.mydomain\.com .+(by mail\.mydomain\.com .+) / REPLACE Received: $1 /^Received: from mac7\.local/ IGNORE /^Received: from .*\.local/ IGNORE
The source of this information, was taken from here