4

I'm using smartsieve web gui to manage my sieve filters. I have a problem with regular expression match.

I'm sending myself a test email with subject in format: testXX (where X is a number between 0 and 9).

When I define a filter: If message 'Subject:' matches regular expression [0-9]+ generated rule is:

elsif allof (header :regex "subject" "[0-9]+") {
    fileinto "INBOX/Tests";
}

message is processed correctly

but any time when I add any text to regular expression... matching fails If message 'Subject:' matches regular expression test[0-9]+ generated rule is:

elsif allof (header :regex "subject" "test[0-9]+") {
    fileinto "INBOX/Tests";
}

When I tested my code using online tool to test sieve scripts everything worked fine, even with more complicated expression. I do need more complicated expression, but i stripped it, because I need to find where the problem is.

Deus777
  • 1,816
  • 1
  • 20
  • 18

1 Answers1

0

If mails that "testXX" and "XX" mail should moved "INBOX/Test", you may do this.

For example:

elsif allof (header :regex "subject" "(test)?\d+") 
{
  fileinto "INBOX/Tests";
}

For an example refer to this.

CC Inc
  • 5,842
  • 3
  • 33
  • 64