Hello

The service method code of my custom mailet:

        public void service(Mail mail) throws MessagingException {
                log("TestMailet: before 
set-"+mail.getAttribute("attribute-test"));
                
                mail.setAttribute("attribute-test", String.valueOf(new 
Date().getTime()));
                
                log("TestMailet: after 
set-"+mail.getAttribute("attribute-test"));
        }

As you can see it's very very simple. I was expecting than in the first pass
the first log showed a null and in the second pass the log showed the
previous set value, but it's always null.

regards,
rafa


rafael.munoz wrote:
> 
> Hi
> 
> First of all, a lot of thanks for your quick reply.
> 
> I'm using file-based repositories so "by hand" I mean moving the two
> files, FileObjectStore and FileStreamStore, from the error directory
> (\\var\mail\error) to the the spool directory (\\var\mail\spool).
> 
> After restarting James I see in the logs that the moved mail is being
> process again by my mailet but retrieving the attribute previously set in
> the fist pass (mail.setAttribute/mail.getAttribute) returns null. 
> 
> Any idea what I'm doing wrong?
> 
> regard and thank you again,
> Rafael Munoz
> 
> 
> Stefano Bagnara-2 wrote:
>> 
>> rafael.munoz ha scritto:
>>> Hello 
>>> 
>>> I have been building some custom matchers/mailets for James and I have a
>>> question regarding the nature of the mail attributes.
>>> 
>>> Are the mail attributes persisted when the mail is stored in a
>>> repository?
>>> 
>>> My user case is simple:
>>> - A mail is processed by my mailets and some attributes are set in the
>>> mail.
>>> - An error happens so the mail is stored in the error repository.
>>> - Using the FromRepository mailet the failed mails are move again to the
>>> spool repository
>>> - Can I expect to have the attributes set in the mail in the
>>> second-pass?
>> 
>> Yes, they are persisted.
>> 
>>> I have done some preliminary tests moving the mails by hand from the
>>> error
>>> repository to the spool repository, but the attributes are empty
>>> indicating
>>> maybe that the attributes are not persistent?
>> 
>> How do you move them by hand?
>> 
>> Stefano
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/mail-attributes-persistence-tp19047177p19048065.html
Sent from the James - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to