Forum

 
Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Regex Syntax

Add a New Topic Reply to Post
UserPost

6:52 am
April 8, 2010


onlyme

USA

Member

posts 6

RKent,

Is there something wrong with this syntax I'm using -> from:/\.dell\.com/

I have this in a rule for like so  [Header Regex Match] [matches] [from:/\.dell\.com]

I received mail from Dell@dellhome.usa.dell.com and the action to move the mail to another folder doesn't occur.

If I just do a straight match: [From] [contains] [.dell.com] to move action works as expected.

Please advise…

Max

Green just makes sense.

7:34 am
April 8, 2010


rkent

Admin

posts 140

There are several different issues here.

First, the Header Regex search term is matching properties of the internal message database, not headers in the original email. They are not necessarily the same. In this particular case, the internal field is called "sender", not "from". Its value is the best available value for the sender in the program. Although it prefers the "From" header, if that is missing it will use substitutes such as "Reply-to". So this is one of the more complex cases.

Second, in a regular expression the "." is a special character that matches any character, so your expression would match dellRcom as well as dell.com

I tested your desired term, and it worked for me when I used: sender:/.caspia.com/  For your case, I think what you really want though is sender:/\.dell\.com/ to only match the "." and not any character.

4:19 am
April 9, 2010


onlyme

USA

Member

posts 6

Hi RKent,

Thanks for the pointer in the direction of "Sender" versus "From".  I'll give that a shot. 

By the way, I had included the backslashes in my post preceding the dots in the regular expression, but they were removed when I submitted the post.  Embarassed  I do understand that the special meaning of the dot has to be removed by using the backslashes.   It was the "header" and the "internal message database" that was the piece of the puzzle I wasn't taking into account.  On that subject, you refer to this fact briefly in the filtaquilla documentation.  Is there a complete reference as to the relationship between the message headers and internal message database that I can use for future reference in creating regular expressions with filtaquilla?

Thanks again.

Max

Green just makes sense.

11:54 am
April 9, 2010


rkent

Admin

posts 140

I do not know of a reference for this information. I went to the base code to confirm what I told you. Documentation would be a good project I agree. Maybe I should add a few more comments about that in mh own FiltaQuilla documentation.

I guess I had expected the most common usage to be for a custom header, and in that case the header name (added with the customdbheaders preference) does match the database value.

Reply to Post

Reply to Topic:
Regex Syntax

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
3 + 6