Hi Barry,

this was a bug. I just fixed it in trunk...

https://issues.apache.org/jira/browse/JAMES-1194

Thx,
Norman

2011/2/14 Barry Bai <yi....@bitrustar.com>:
> Hi, I just added the below content in mailetcontainer.xml:
>   <mailet match="StorageQuotaFixed=4m" class="ToProcessor">
>        <processor>bounces</processor>
>   </mailet>
>
> When the space overs the quota, the DSNBounce will be invoked, but there is a 
> NPE.
>
> Is there any mistake in my configuration?
>
> the stack is as below:
> java.lang.NullPointerException
>        at java.util.regex.Matcher.getTextLength(Unknown Source)
>        at java.util.regex.Matcher.reset(Unknown Source)
>        at java.util.regex.Matcher.<init>(Unknown Source)
>        at java.util.regex.Pattern.matcher(Unknown Source)
>        at 
> org.apache.james.transport.mailets.DSNBounce.createDSN(DSNBounce.java:377)
>        at 
> org.apache.james.transport.mailets.DSNBounce.service(DSNBounce.java:204)
>        at 
> org.apache.james.mailetcontainer.camel.CamelProcessor.process(CamelProcessor.java:66)
>        at 
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at 
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>        at 
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>        at 
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at 
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
>        at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
>        at 
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at 
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>        at 
> org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:80)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at 
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>        at 
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>        at 
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at 
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
>        at 
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>        at 
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at 
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
>        at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
>        at 
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at 
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
>        at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
>        at 
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
>        at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
>        at 
> org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:515)
>        at 
> org.apache.camel.processor.MulticastProcessor.access$100(MulticastProcessor.java:73)
>        at 
> org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:239)
>        at 
> org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:231)
>        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>        at java.util.concurrent.FutureTask.run(Unknown Source)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown 
> Source)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>        at java.lang.Thread.run(Unknown Source)
>
> Thank you very much.
>
> 2011-02-14
>
>
>
> Barry Bai
>
>
>
> 发件人: Norman Maurer
> 发送时间: 2011-02-14  14:05:12
> 收件人: James Developers List
> 抄送: James Users List
> 主题: Re: Re: Re: How to do limitation space of mailbox
>
> Hi there,
> you will need to call the "DNSBounce" mailet after match your Matcher.
> See:
> http://james.apache.org/server/3/dev-provided-mailets.html
> Bye,
> Norman
> 2011/2/14 Barry Bai <yi....@bitrustar.com>:
>> Sorry, I was wrong, although the Quota matcher is working, when overing 
>> quota, the mail can still be stored. I think when overing quota, James 
>> should reject the mail and notify sender, right? I don't know how to 
>> implement this.
>>
>> Thanks.
>>
>>
>> 2011-02-14
>>
>>
>>
>> Barry Bai
>>
>>
>>
>> 发件人: Barry Bai
>> 发送时间: 2011-02-14  13:00:37
>> 收件人: James Users List; server-dev
>> 抄送:
>> 主题: Re: Re: How to do limitation space of mailbox
>>
>> Hi, I have fixed some wrong in the AbstractStorageQuota.java and it is 
>> working now. Next step is do some optimizing and add some cach mechanism.
>>
>> Thanks for Eric and Norman's help.
>> 2011-02-14
>>
>>
>>
>> Barry Bai
>>
>>
>>
>> 发件人: Norman Maurer
>> 发送时间: 2011-02-11  18:32:44
>> 收件人: James Users List
>> 抄送:
>> 主题: Re: How to do limitation space of mailbox
>> Sorry I was wrong,,
>> there is an Abstract base class you could extend to build in such a
>> Matcher. But its far from optimal ...
>> http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractStorageQuota.java?view=markup
>> Bye,
>> Norman
>> 2011/2/11 Eric Charles <e...@apache.org>:
>>> I suppose RecipientIsOverFixedQuota was not taken in trunk due to non
>>> optimal implementation (count on every call).
>>> But this could be a start for users who want to try and ameliorate it.
>>>
>>> So, Barry, simply take the 2.3.2 RecipientIsOverFixedQuota as an
>>> additional jar, configure the mailetcontainer.xml (which extends
>>> AbstractStorageQuota which extends AbstractQuotaMatcher), and tell us if
>>> this works for you :)
>>>
>>> Tks,
>>>
>>> Eric
>>>
>>>
>>> Do we need to simply use the 2.3.2 RecipientIsOverFixedQuota
>>>
>>> On 11/02/2011 07:10, Norman Maurer wrote:
>>>> Hi Eric,
>>>>
>>>> RecipeintIsOverFixedQuota is working with trunk.. Well to be exact,
>>>> kind of ;) It only respect messages in the INBOX and not in the
>>>> subfolders. It it need to count the size on every call so its
>>>> ultra-inefficent.
>>>>
>>>> Bye,
>>>> Norman
>>>>
>>>> 2011/2/11 Eric Charles <e...@apache.org>:
>>>>> (btw, 2.3.2 RecipientIsOverFixedQuota won't help you much - you really
>>>>> need to develop it from scratch).
>>>>>
>>>>>
>>>>> On 11/02/2011 06:54, Eric Charles wrote:
>>>>>> Hi,
>>>>>>
>>>>>> The documentation to develop custom mailet/matcher is here
>>>>>> http://james.apache.org/server/3/dev-extend-mailet.html
>>>>>> http://james.apache.org/server/3/dev-extend-matcher.html
>>>>>> (see also http://markmail.org/thread/346wzxsksdvhlnee for the mailet
>>>>>> package specification change in M3)
>>>>>>
>>>>>> The mailet/matcher configuration occurs in mailtecontainer.xml
>>>>>> http://james.apache.org/server/3/config-mailetcontainer.html
>>>>>>
>>>>>> The RecipientIsOverFixedQuota matcher is mentioned on
>>>>>> http://james.apache.org/server/3/dev-provided-matchers.html but is no
>>>>>> more in 3.0 trunk.
>>>>>> You can view RecipientIsOverFixedQuota 2.3.2 source on
>>>>>>
>>>>>>
>>>>>> Hope this helps,
>>>>>>
>>>>>> Eric
>>>>>>
>>>>>>
>>>>>> On 11/02/2011 03:42, Barry Bai wrote:
>>>>>>> I have seen some examples with the url you provided, but I can't still 
>>>>>>> make clear the process of mailet and matcher or how to invoke them, 
>>>>>>> etc. I am looking foward your details.
>>>>>>>
>>>>>>> I am trying to write a "quota matcher" of James3 for per user, it is 
>>>>>>> mentioned by Eric. it is very urgent for me, so I just do some 
>>>>>>> researching on it.
>>>>>>>
>>>>>>> Thanks.
>>>>>>> 2011-02-11
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Barry Bai
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 发件人: agks mehx
>>>>>>> 发送时间: 2011-02-11  10:20:38
>>>>>>> 收件人: James Users List
>>>>>>> 抄送:
>>>>>>> 主题: Re: Re: How to do limitation space of mailbox
>>>>>>>
>>>>>>> A bit difficult to read but if you work through these examples should 
>>>>>>> give
>>>>>>> you everything you need:
>>>>>>> http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/
>>>>>>> If you need help with configuration see emails about mailets on this 
>>>>>>> list in
>>>>>>> the last couple of days.
>>>>>>> I'm sure eventually there will be better documentation/tutorials but 
>>>>>>> for now
>>>>>>> this is all I am aware of.
>>>>>>> On Thu, Feb 10, 2011 at 3:37 PM, Barry Bai <yi....@bitrustar.com> wrote:
>>>>>>>> Hi Eirc, could you please provide some tutorial or other material about
>>>>>>>> developing customized mailet and matcher in James 3.0? I can just find 
>>>>>>>> some
>>>>>>>> technical material for James 2 in the official website and they should 
>>>>>>>> not
>>>>>>>> be applicable for James 3, right?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> 2011-02-11
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Barry Bai
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 发件人: Eric Charles
>>>>>>>> 发送时间: 2011-02-10  15:36:40
>>>>>>>> 收件人: James Users List
>>>>>>>> 抄送:
>>>>>>>> 主题: Re: How to do limitation space of mailbox
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>> There was a "quota matcher" developed for James 2.2, but that is  not
>>>>>>>> supported in james 3.0 mailbox (the way mails are persisted in
>>>>>>>> completely different in 3.0).
>>>>>>>> To my knowledge, we don't have an out-of-the-box solution to support
>>>>>>>> quota in 3.0.
>>>>>>>> You could open a JIRA,  trying to express your requirements : is it
>>>>>>>> quota per user or per mailbox (or both?), do you see it more as part of
>>>>>>>> the mailbox or the server project, is there a default value always
>>>>>>>> applicable,...
>>>>>>>> If you don't have a more precise idea, simply open it without detail.
>>>>>>>> Tks,
>>>>>>>> Eric
>>>>>>>> On 9/02/2011 10:25, Barry Bai wrote:
>>>>>>>>> Hi, in James V3, how to limit space  of mailbox for one user?
>>>>>>>>>
>>>>>>>>> Thanks a lot.
>>>>>>>>>
>>>>>>>>> 2011-02-09
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Barry Bai
>>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
>>>>>>>> For additional commands, e-mail: server-user-h...@james.apache.org
>>>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
>>>>> For additional commands, e-mail: server-user-h...@james.apache.org
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
>>>> For additional commands, e-mail: server-user-h...@james.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
>>> For additional commands, e-mail: server-user-h...@james.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
>> For additional commands, e-mail: server-user-h...@james.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>

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

Reply via email to