You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by "USHAKOV, Sergey" <s-...@nm.ru> on 2011/04/01 04:40:14 UTC

Boolean combination of matchers for a mailet

Hi all,

having turned to configurling mailets I have quickly run into an issue of 
combining matchers for a mailet.

What would be the right approach to implement the logics: match all messages 
with ("SenderIs=..."  AND "SubjectStartsWith=...") and supply them to mailet 
X?

Thanks in advance and best regards,
Sergey


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Regex matchers missing

Posted by "USHAKOV, Sergey" <s....@chemitech.ru>.
Ok, I'll get my matchers documented :) , maybe refactored a little and 
submit as you suggest.

Regards,
Sergey


----- Original Message ----- 
From: "Norman" <no...@apache.org>
To: <se...@james.apache.org>
Sent: Tuesday, April 05, 2011 11:00 AM
Subject: Re: Regex matchers missing


> Hi there,
>
> comments inline...
>
>
> Am 05.04.2011 05:39, schrieb USHAKOV, Sergey:
>> Hi again,
>>
>> I've had a look at the source code of regex matchers that was available 
>> in
>> the M2 bundle, and my impression is that they may be waiting for some
>> refactoring, as in their present state they depend on the deprecated ORO
>> project...
>>
>> Are there any existing plans on these matchers?
>
> These matchers were refactored to remove the use of ORO. For example see:
> http://svn.apache.org/viewvc/james/mailet/standard/trunk/src/main/java/org/apache/james/transport/matchers/RecipientIsRegex.java?view=log
>
>
>
>>
>> Meanwhile in the absense of these matchers in the build I've written a 
>> bunch
>> of my own - including some others following similar semantics :)
>> This is the list (names speaking for themselves):
>> - HasRecipientAddress
>> - HasRecipientAddressContaining
>> - HasRecipientAddressMatchingRegex
>> - HasRecipientNameContaining
>> - HasRecipientNameMatchingRegex
>> - SenderAddressIs
>> - SenderAddressMatchesRegex
>> - SenderAngledAddressContains
>> - SenderNameContains
>> - SenderNameMatchesRegex
>> - SubjectContains
>> - SubjectMatchesRegex
>>
>> Might it be a good idea to submit them to the project?
>
> Sure.... We love contributions. Just open a JIRA Ticket and attach the 
> source code.
>
> https://issues.apache.org/jira/browse/MAILETSTANDARD
>
>
>
>
>>
>> Regards,
>> Sergey
>>
>>
>> ----- Original Message ----- From: "USHAKOV, Sergey" 
>> <s-...@yandex.ru>
>> To: "James Users List" <se...@james.apache.org>
>> Sent: Friday, April 01, 2011 12:37 PM
>> Subject: Regex matchers missing
>>
>>
>>> Thanks Norman, I'll get this matcher tested in a day or so.
>>>
>>> Meanwhile I've run into one more problem. It looks like that varioius
>>> regex
>>> matchers are missing from the snapshot build. At least neither the
>>> classloader nor me could find them :)
>>>
>>> Could you get them back into the build? Or give me a clue of the right 
>>> way
>>> to get hold of them?..
>>>
>>> Thanks and best regards,
>>> Sergey
>>>
>>>
>>> ----- Original Message ----- From: "Norman" <no...@apache.org>
>>> To: <se...@james.apache.org>
>>> Sent: Friday, April 01, 2011 9:28 AM
>>> Subject: Re: Boolean combination of matchers for a mailet
>>>
>>>
>>>> This feature is only supported in current trunk. It would be look like:
>>>>
>>>> <!-- Start of config -->
>>>> <matcher name="anyname"
>>>> match="org.apache.james.mailetcontainer.lib.matcher.And">
>>>> <matcher match="SenderIs...."/>
>>>> <matcher match="SubjectStartsWith...."/>
>>>> </matcher>
>>>>
>>>> <mailet match="anyname" class="MailetX"/>
>>>> <!-- End of config -->
>>>>
>>>> Let me know if it work...
>>>>
>>>> Bye,
>>>> Norman
>>>>
>>>> Am 01.04.2011 04:40, schrieb USHAKOV, Sergey:
>>>>> Hi all,
>>>>>
>>>>> having turned to configurling mailets I have quickly run into an issue
>>>>> of
>>>>> combining matchers for a mailet.
>>>>>
>>>>> What would be the right approach to implement the logics: match all
>>>>> messages with ("SenderIs=..."  AND "SubjectStartsWith=...") and supply
>>>>> them to mailet X?
>>>>>
>>>>> Thanks in advance and best regards,
>>>>> Sergey
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>>
>>>>
>>>>
>
> Bye,
> Norman
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Regex matchers missing

Posted by Norman <no...@apache.org>.
Hi there,

comments inline...


Am 05.04.2011 05:39, schrieb USHAKOV, Sergey:
> Hi again,
>
> I've had a look at the source code of regex matchers that was 
> available in
> the M2 bundle, and my impression is that they may be waiting for some
> refactoring, as in their present state they depend on the deprecated ORO
> project...
>
> Are there any existing plans on these matchers?

These matchers were refactored to remove the use of ORO. For example see:
http://svn.apache.org/viewvc/james/mailet/standard/trunk/src/main/java/org/apache/james/transport/matchers/RecipientIsRegex.java?view=log



>
> Meanwhile in the absense of these matchers in the build I've written a 
> bunch
> of my own - including some others following similar semantics :)
> This is the list (names speaking for themselves):
> - HasRecipientAddress
> - HasRecipientAddressContaining
> - HasRecipientAddressMatchingRegex
> - HasRecipientNameContaining
> - HasRecipientNameMatchingRegex
> - SenderAddressIs
> - SenderAddressMatchesRegex
> - SenderAngledAddressContains
> - SenderNameContains
> - SenderNameMatchesRegex
> - SubjectContains
> - SubjectMatchesRegex
>
> Might it be a good idea to submit them to the project?

Sure.... We love contributions. Just open a JIRA Ticket and attach the 
source code.

https://issues.apache.org/jira/browse/MAILETSTANDARD




>
> Regards,
> Sergey
>
>
> ----- Original Message ----- From: "USHAKOV, Sergey" 
> <s-...@yandex.ru>
> To: "James Users List" <se...@james.apache.org>
> Sent: Friday, April 01, 2011 12:37 PM
> Subject: Regex matchers missing
>
>
>> Thanks Norman, I'll get this matcher tested in a day or so.
>>
>> Meanwhile I've run into one more problem. It looks like that varioius
>> regex
>> matchers are missing from the snapshot build. At least neither the
>> classloader nor me could find them :)
>>
>> Could you get them back into the build? Or give me a clue of the 
>> right way
>> to get hold of them?..
>>
>> Thanks and best regards,
>> Sergey
>>
>>
>> ----- Original Message ----- From: "Norman" <no...@apache.org>
>> To: <se...@james.apache.org>
>> Sent: Friday, April 01, 2011 9:28 AM
>> Subject: Re: Boolean combination of matchers for a mailet
>>
>>
>>> This feature is only supported in current trunk. It would be look like:
>>>
>>> <!-- Start of config -->
>>> <matcher name="anyname"
>>> match="org.apache.james.mailetcontainer.lib.matcher.And">
>>> <matcher match="SenderIs...."/>
>>> <matcher match="SubjectStartsWith...."/>
>>> </matcher>
>>>
>>> <mailet match="anyname" class="MailetX"/>
>>> <!-- End of config -->
>>>
>>> Let me know if it work...
>>>
>>> Bye,
>>> Norman
>>>
>>> Am 01.04.2011 04:40, schrieb USHAKOV, Sergey:
>>>> Hi all,
>>>>
>>>> having turned to configurling mailets I have quickly run into an issue
>>>> of
>>>> combining matchers for a mailet.
>>>>
>>>> What would be the right approach to implement the logics: match all
>>>> messages with ("SenderIs=..."  AND "SubjectStartsWith=...") and supply
>>>> them to mailet X?
>>>>
>>>> Thanks in advance and best regards,
>>>> Sergey
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>
>>>
>>>

Bye,
Norman



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Regex matchers missing

Posted by "USHAKOV, Sergey" <s....@chemitech.ru>.
Hi again,

I've had a look at the source code of regex matchers that was available in
the M2 bundle, and my impression is that they may be waiting for some
refactoring, as in their present state they depend on the deprecated ORO
project...

Are there any existing plans on these matchers?

Meanwhile in the absense of these matchers in the build I've written a bunch
of my own - including some others following similar semantics :)
This is the list (names speaking for themselves):
- HasRecipientAddress
- HasRecipientAddressContaining
- HasRecipientAddressMatchingRegex
- HasRecipientNameContaining
- HasRecipientNameMatchingRegex
- SenderAddressIs
- SenderAddressMatchesRegex
- SenderAngledAddressContains
- SenderNameContains
- SenderNameMatchesRegex
- SubjectContains
- SubjectMatchesRegex

Might it be a good idea to submit them to the project?

Regards,
Sergey


----- Original Message ----- 
From: "USHAKOV, Sergey" <s-...@yandex.ru>
To: "James Users List" <se...@james.apache.org>
Sent: Friday, April 01, 2011 12:37 PM
Subject: Regex matchers missing


> Thanks Norman, I'll get this matcher tested in a day or so.
>
> Meanwhile I've run into one more problem. It looks like that varioius
> regex
> matchers are missing from the snapshot build. At least neither the
> classloader nor me could find them :)
>
> Could you get them back into the build? Or give me a clue of the right way
> to get hold of them?..
>
> Thanks and best regards,
> Sergey
>
>
> ----- Original Message ----- 
> From: "Norman" <no...@apache.org>
> To: <se...@james.apache.org>
> Sent: Friday, April 01, 2011 9:28 AM
> Subject: Re: Boolean combination of matchers for a mailet
>
>
>> This feature is only supported in current trunk. It would be look like:
>>
>> <!-- Start of config -->
>> <matcher name="anyname"
>> match="org.apache.james.mailetcontainer.lib.matcher.And">
>> <matcher match="SenderIs...."/>
>> <matcher match="SubjectStartsWith...."/>
>> </matcher>
>>
>> <mailet match="anyname" class="MailetX"/>
>> <!-- End of config -->
>>
>> Let me know if it work...
>>
>> Bye,
>> Norman
>>
>> Am 01.04.2011 04:40, schrieb USHAKOV, Sergey:
>>> Hi all,
>>>
>>> having turned to configurling mailets I have quickly run into an issue
>>> of
>>> combining matchers for a mailet.
>>>
>>> What would be the right approach to implement the logics: match all
>>> messages with ("SenderIs=..."  AND "SubjectStartsWith=...") and supply
>>> them to mailet X?
>>>
>>> Thanks in advance and best regards,
>>> Sergey
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Regex matchers missing

Posted by "USHAKOV, Sergey" <s-...@yandex.ru>.
Thanks Norman, I'll get this matcher tested in a day or so.

Meanwhile I've run into one more problem. It looks like that varioius regex
matchers are missing from the snapshot build. At least neither the
classloader nor me could find them :)

Could you get them back into the build? Or give me a clue of the right way
to get hold of them?..

Thanks and best regards,
Sergey


----- Original Message ----- 
From: "Norman" <no...@apache.org>
To: <se...@james.apache.org>
Sent: Friday, April 01, 2011 9:28 AM
Subject: Re: Boolean combination of matchers for a mailet


> This feature is only supported in current trunk. It would be look like:
>
> <!-- Start of config -->
> <matcher name="anyname"
> match="org.apache.james.mailetcontainer.lib.matcher.And">
> <matcher match="SenderIs...."/>
> <matcher match="SubjectStartsWith...."/>
> </matcher>
>
> <mailet match="anyname" class="MailetX"/>
> <!-- End of config -->
>
> Let me know if it work...
>
> Bye,
> Norman
>
> Am 01.04.2011 04:40, schrieb USHAKOV, Sergey:
>> Hi all,
>>
>> having turned to configurling mailets I have quickly run into an issue of
>> combining matchers for a mailet.
>>
>> What would be the right approach to implement the logics: match all
>> messages with ("SenderIs=..."  AND "SubjectStartsWith=...") and supply
>> them to mailet X?
>>
>> Thanks in advance and best regards,
>> Sergey
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Boolean combination of matchers for a mailet

Posted by "USHAKOV, Sergey" <s-...@nm.ru>.
Yes Norman, many thanks. I've checked - it works for me... :)

Regards,
Sergey


----- Original Message ----- 
From: "Norman" <no...@apache.org>
To: <se...@james.apache.org>
Sent: Friday, April 01, 2011 9:28 AM
Subject: Re: Boolean combination of matchers for a mailet


> This feature is only supported in current trunk. It would be look like:
> 
> <!-- Start of config -->
> <matcher name="anyname" 
> match="org.apache.james.mailetcontainer.lib.matcher.And">
> <matcher match="SenderIs...."/>
> <matcher match="SubjectStartsWith...."/>
> </matcher>
> 
> <mailet match="anyname" class="MailetX"/>
> <!-- End of config -->
> 
> Let me know if it work...
> 
> Bye,
> Norman
> 
> Am 01.04.2011 04:40, schrieb USHAKOV, Sergey:
>> Hi all,
>>
>> having turned to configurling mailets I have quickly run into an issue 
>> of combining matchers for a mailet.
>>
>> What would be the right approach to implement the logics: match all 
>> messages with ("SenderIs=..."  AND "SubjectStartsWith=...") and supply 
>> them to mailet X?
>>
>> Thanks in advance and best regards,
>> Sergey
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 
> 
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Boolean combination of matchers for a mailet

Posted by Norman <no...@apache.org>.
This feature is only supported in current trunk. It would be look like:

<!-- Start of config -->
<matcher name="anyname" 
match="org.apache.james.mailetcontainer.lib.matcher.And">
<matcher match="SenderIs...."/>
<matcher match="SubjectStartsWith...."/>
</matcher>

<mailet match="anyname" class="MailetX"/>
<!-- End of config -->

Let me know if it work...

Bye,
Norman

Am 01.04.2011 04:40, schrieb USHAKOV, Sergey:
> Hi all,
>
> having turned to configurling mailets I have quickly run into an issue 
> of combining matchers for a mailet.
>
> What would be the right approach to implement the logics: match all 
> messages with ("SenderIs=..."  AND "SubjectStartsWith=...") and supply 
> them to mailet X?
>
> Thanks in advance and best regards,
> Sergey
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org