This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[6.301] Problem with Expression Filter

Hi,
I have a problem with the expression filter:


I have entered the expression: user1.+\@domain\.com
(means adress user1X@domain.com  is blocked). This Works!

Now if I write an email with two addresses in the TO field
(e.g. user1@domain.com and user2@domain.com)

I get that user 1 is blacklisted???

Here is the SMTP Log:
2006:08:03-08:53:13 (none) exim[32486]: [35\38]   X-OriginalArrivalTime: 03 Aug 2006 06:53:11.0290 (UTC) FILETIME=[7C1265A0:01C6B6C9]
2006:08:03-08:53:13 (none) exim[32486]: [36\38]   X-LOC-Local-RCPT: user1@domain.com
2006:08:03-08:53:13 (none) exim[32486]: [37\38]   X-LOC-Local-RCPT: user2@domain.com
2006:08:03-08:53:13 (none) exim[32486]: [38/38]   X-Regex-Match: user1.+\@domain\.com (blacklisted)

Anyone an Idea [:S]


This thread was automatically locked due to age.
Parents
  • Hi,

    Im not sure what you want to change... [:S]

    But yes that is true if any thing matches then its trigged. If you try to send from ONLY user2 then it will not be blacklisted.

    Also have a look at this site
    http://www.regular-expressions.info/reference.html
  • Hi, 
    I think you did not get me right:

    I have the following expression:
    user1.+\@domain\.com

    This should block following addresses (any
    char or chars are added after the name):
    user1a@domain.com
    user1aa@domain.com
    user1aaa@domain.com
    user1b@domain.com
    user1bb@domain.com
    ...

    It should let pass following address:
    user1@domain.com

    If I write a single email to user1@domain.com is NOT blocked. Thats okay!

    But if I write a single email to user1@domain.com and to user2@domain.com
    (both in the TO Field) ASL says that user1@domain.com is blocked, but it shouldn't

    cu SveN
  • Hi,

    Sounds like it triggers if you have anything not only user2 after the first user. Have you tried with anything else like testuser@domain.com as number 2?
    Just to eliminate if he triggers on anything as number 2.

    If that is the case later that he triggers on anything i think its more a bug then an error from your script.
  • Hi there all, 

    the ASG Content Filter does mathing over multiple lines.

    This means that the expression: user1.+\@domain\.com

    is a little bit greedy.

    if you apply it to
    2006:08:03-08:53:13 (none) exim[32486]: [36\38] X-LOC-Local-RCPT: [noparse]user1@domain.com[/noparse]
    2006:08:03-08:53:13 (none) exim[32486]: [37\38] X-LOC-Local-RCPT: [noparse]user2@domain.com[/noparse]
    2006:08:03-08:53:13 (none) exim[32486]: [38/38] X-Regex-Match: user1.+\@domain\.com (blacklisted)


    the following part is matched
    2006:08:03-08:53:13 (none) exim[32486]: [36\38] X-LOC-Local-RCPT: user1@domain.com
    2006:08:03-08:53:13 (none) exim[32486]: [37\38] X-LOC-Local-RCPT: [noparse]user2@domain.com[/noparse]

    2006:08:03-08:53:13 (none) exim[32486]: [38/38] X-Regex-Match: user1.+\@domain\.com (blacklisted)


    because the '.+' matches also the line break.

    just try this regexp instead:
    user1[^@]+\@domain\.com

    [^@] means a character class witt all charactes except '@'.

    regards
    Gert
  • Hi Gert,
    thanks for the reply. Now it's clear why the message got blocked. Maybe this
    should be updated in the documentation?

    For me it was not clear against which part of the email the Regular Expression is used. The help says: "The Expression Filter can be used to filter mails based on the presence of byte strings in the body of the mail." Now you tell that the regex is used against the log.... ???

    cu SveN
Reply
  • Hi Gert,
    thanks for the reply. Now it's clear why the message got blocked. Maybe this
    should be updated in the documentation?

    For me it was not clear against which part of the email the Regular Expression is used. The help says: "The Expression Filter can be used to filter mails based on the presence of byte strings in the body of the mail." Now you tell that the regex is used against the log.... ???

    cu SveN
Children
No Data