Hello, using ISPConfig 3.2.8p1. Is there any way to creae filter like this? If incoming message (mail) containts word ABC in subject, then send copy of this email to [email protected] How can I do that please? Very thank you.
Try: Code: if header :regex "subject" ["^ABC$"] { redirect "[email protected]"; stop; } but subject must be really just ABC and nothing else like other text or even whitespace, often it is better using something like: Code: if header :regex "subject" ["^.*ABC"] { redirect "[email protected]"; stop; } which means subject just has to contain ABC.
Code: if header :regex "subject" ["^.*ABC"] { redirect "[email protected]"; stop; } @till thank you, tried it but have some problems: subject is "ABC", no copy sent to my email subject is "test ABC", no copy sent to my email subject is "ABC test", copy is sent to my email but don't see message in original mail account (tried to replace redirect for cc too)
This happens due to the stop line. If you like to get the message in the original account too, then remove the stop line.
To test regular expressions find test tools using Internet Search Engines with Code: regular expression tester Then you can test when the expression matches and when not.
You can also look at sieve documentation (eg. rfc 5228) for more info, eg. I believe there is a ':contains' match type that does exactly what you want without needing to form a regular expression from it.