1

Topic: Nested Forwarding rule seems to work but forwards twice.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 6
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Alma 8
- 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.
====

Hi,

I have created a Nested Forwarding rule, it seems to work but forwards twice.

here is the rule:

# rule:[Forward01]
if allof (
not header :contains "Delivered-To" "user.004@domain.com", not header :contains "Delivered-To" "postmaster@domain.com", not header :contains "Delivered-To" "dmarc@domain.com", not header :contains "Delivered-To" "abuse@domain.com", not body :text :contains"TestEmail"
)

{
if anyof (
header :contains "Delivered-To" "user.001@domain.com", header :contains "Delivered-To" "user.002@domain.com", header :contains "Delivered-To" "user.003@domain.com"
)
{
redirect :copy "user.004@domain.com";
stop;
}
}

Reason for rule is so that
user.001 user.002 user.003 are forwarded to user.004
while
user.005 user.006 user.007 are forwarded to user.008
while
user.009 user.010 user.011 are forwarded to user.012

And I am creating this rule server wide. So it needs to be able to know not to create forwarding loops.

So yeah is there a way to find out why it forwards twice? I assume it forwards once for the allof and once for the anyof? rather than treating the anyof as a nested if statement to the first allof if statement?

but not sure where in the logs to find the answer.

Thank you.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.