Content Filter Rule that like replicating emails, how to solve.
-
I have several rules similar to the one below. They all have the same thing in common, they replicate the email by the number of copy tasks, so the rule below puts two copies of the email into each copy location.
RuleName=Alerts: [CP] noreply_redmine uid={6b073a4c-b009-4779-8e5f-af27e6e3b2f2} Enable=Yes ThisRuleCondition=All ProcessQueue=LOCAL Condition01=TO|contains|AND|noreply_redmine@cfts.co| Action01=copy to public folders|"Logs and Alerts/Redmine" Action02=copy to|"support@cfts.co","xxxx@cfts.co"
Sample below.
Is their a way to dedup or format the rule, so it does not do this? I have tried, but found no solution.
Any help in this matter would be greatly appreciated.
-
Arron Staff
When MDaemon receives messages addressed to multiple recipients, it creates a copy for each recipient and each copy is processed by the content filter. The two copies of the message will have identical To and CC headers, so if you are checking the To and CC headers with your rule, then both copies of the message will match the rule. To avoid this check the X-MDaemon-Deliver-To header instead of the To header. This header will always contain the email address that message is being delivered to.
-
[Rule009] RuleName=Alerts: [CP] noreply_redmine uid={6b073a4c-b009-4779-8e5f-af27e6e3b2f2} Enable=No ThisRuleCondition=All ProcessQueue=BOTH Condition01=X-MDAEMON-DELIVER-TO|contains|AND|noreply_redmine@cfts.co| Action01=copy to|"support@cfts.co","tasha@cfts.co" Action02=copy to public folders|"Logs and Alerts/Redmine"
Thanks Arron, that worked in regards to not repeating but seems the copy to accounts function does not work, as well as the copy to public folder no longer works!
Thsi is the mail header just in case.
Return-path: <noreply_redmine@cfts.co> Authentication-Results: mail1.cfts.co; iprev=pass reason="white listed" policy.iprev=172.16.198.21 (MAIL noreply_redmine@cfts.co) Received: from redmine.cfts.co [(172.16.198.21)] by mail1.cfts.co (172.16.198.44) with ESMTPS id md5001000584342.msg; Sun, 03 Sep 2023 22:36:34 +0300 X-Spam-Processed: mail1.cfts.co, Sun, 03 Sep 2023 22:36:34 +0300 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 172.16.198.21 X-MDArrival-Date: Sun, 03 Sep 2023 22:36:34 +0300 X-Rcpt-To: peter@cfts.co X-MDRcpt-To: peter@cfts.co X-Return-Path: prvs=1610f8a658=noreply_redmine@cfts.co X-Envelope-From: noreply_redmine@cfts.co X-MDaemon-Deliver-To: peter@cfts.co Received: from localhost.localdomain (localhost [127.0.0.1]) by redmine.cfts.co (8.14.7/8.14.7) with ESMTP id 383JaW74015641 for <peter@cfts.co>; Sun, 3 Sep 2023 22:36:32 +0300 Date: Sun, 03 Sep 2023 22:36:32 +0300 From: noreply_redmine@cfts.co Message-ID: <64f4e0408f775_7c67353c0668d8@redmine.cfts.co.mail> Subject: Easy Redmine test Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_64f4e0408901d_7c67353c066712"; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: Redmine X-Redmine-Host: redmine.cfts.co X-Redmine-Site: CFTS Project Management System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: X-MDCFSigsAdded: cfts.co X-MDArchived: mail1.cfts.co, Sun, 03 Sep 2023 22:36:39 +0300
If I give 2 or more email accounts the same aliase, will the messages be delivered to them all or just the first one, and should there be anything i be aware of if i do that?
Did a test Looks like you can't reuse aliases :(
I get the mail, but public folder does not and the copy to accounts don't work either!
I'm I doing somthing wrong, or any advice on how I should approch this?
-
After some playing arround and resorting back to FROM, it works but of course the replication email issue persists.
When using 'X-MDaemon-Deliver-To' the rule seems not to work, I'd love to know what im doing wrong!Current rule running, sort of working,
[Rule016] RuleName=Alerts: [CP] noreply_redmine uid={6b073a4c-b009-4779-8e5f-af27e6e3b2f2} Enable=Yes ThisRuleCondition=All ProcessQueue=LOCAL Condition01=FROM|contains|OR|noreply_redmine@cfts.co| Action01=copy to|"support@cfts.co","tasha@cfts.co" Action02=copy to public folders|"Logs and Alerts/Redmine"
Same rule but using 'X-MDaemon-Deliver-To' that does not work at all.
[Rule016] RuleName=Alerts: [CP] noreply_redmine uid={6b073a4c-b009-4779-8e5f-af27e6e3b2f2} Enable=Yes ThisRuleCondition=All ProcessQueue=LOCAL Condition01=X-MDAEMON-DELIVER-TO|contains|OR|noreply_redmine@cfts.co| Action01=copy to|"support@cfts.co","tasha@cfts.co" Action02=copy to public folders|"Logs and Alerts/Redmine"
any ideas?
-
Arron Staff
According to the email headers you've posted, the X-MDaemon-Deliver-To header contains peter@cfts.co.
X-MDaemon-Deliver-To: peter@cfts.co
And the rule you are using is checking the X-MDaemon-Deliver-To header for noreply_redmine@cfts.co.
Condition01=X-MDAEMON-DELIVER-TO|contains|AND|noreply_redmine@cfts.co|
The X-MDaemon-Deliver-To header will contain the email address of the mailbox that the message is being delivered to. If you want the rule to match the message you provided the headers for, you would need to check the X-MDaemon-Deliver-To header for peter@cfts.co.
-
@Arron that becouse its sent to me direct, as well as to noreply_redmine@cfts.co, as said it working with 'From' fine, except for the replication.
Can I use maybe a custom header? such as, my reall issue is, I seem to have very little visability on this.
X-Redmine-Site: CFTS Project Management System
or
X-Envelope-From: noreply_redmine@cfts.co
-
@Arron, I've been stupid, I should just make a group (list) with the email address I want the emails to be sent to...
-
OK done 'mailing lists' is the way to go, all works perfectly, even allows the mail to be dropped into a given public directory, just goes to show, if all you have is a hammer everything looks like a nail.
-
Arron Staff
I'm glad you found another way and that its working for you. If you decide to take another look at the content filter rule, just let me know.