Filtering Recipients with Wildcard

Issue #1145 resolved
Brett created an issue

I am trying to exclude email recipients whose email addresses start with a 2 or a 3. When I add the rule From: *, To: 2*, or From: *, To: 3*, It filters out all emails and stops archiving. Should I be using a different approach than using a wildcard after the first character?

Comments (11)

  1. Brett reporter

    I still get the same result when I leave the From field blank, it stops archiving any emails. Seems like the issue is when I use a Wildcard after a character. I have rules with Wildcards before the email domain and those rules work as expected.

  2. Janos SUTO repo owner

    Use the pilertest utility to test your rules and emails. Take 2 emails: one matching to this rule (ie. having a recipient with 3* address), and another with perhaps 4*. Then run pilertest on them. It will print how the parser sees the message, and reveal the matching rule if there’s any.

  3. Brett reporter

    I couldn’t ever get this to work. It seems like there might be a 5 character minimum for this, because if I did “xxxxx*” (where the x’s are the first 5 characters of a particular email address) then it would work. But in my case I am needing to filter all recipient emails beginning with a 2 or 3, from being archived.

    Any help with this would be appreciated.

  4. Brett reporter

    Correct, and I have several other rules that work just fine. But when I do 3* or 2* for recipient, nothing gets archived.

  5. Janos SUTO repo owner

    Please show me two messages with full headers: one that should be archived and one that should not, but the rule catches it.

  6. Brett reporter

    Looks like I found a solution. In our case, we have email addresses that start with two digits, that should not be archived (Ex. 22******@******.net or 30******@******.net). Whenever I use a wildcard * , if my rules ends with a wildcard everything gets filtered from being archived. In my case, since we have two digits at the beginning of these email addresses I did the following, *0, *1, *2, *3, *4, *5, *6, *7, *8, *9, for the Recipient Field and a * for the From Field and this covers the emails that I needed excluded from archiving. As mentioned before using 2*, or 3*, would filter everything out, so you may want to look into that. But in our case this workaround resolved our issues. Thank you for your help.

  7. Log in to comment