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 Gusnadi Kevin <gu...@ncs.com.sg> on 2010/06/09 11:37:05 UTC

About Message_Name in inbox table

Hi Guys :)

I have the following problems :

I'm using DB as the repository .

So each times there is incoming mail to JAMES there will be record
inserted to the inbox tables . for example :

Message_name            repository_name    message_state
blablabla.....
Mail1274326357299-0	andy               root
blablabla.....



My problem is :

- each time there is incoming mails i need to get message_name of each
incoming mails record , and save it to my own table . Can anyone share
some way to do it ?

Or

Can anyone tell me which class that JAMES use to do the insertion to the
db

Thanks and Regards
Kevin

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


Re: About Message_Name in inbox table

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

with current stable version (2.3.2) its not possible to add some kind
of listener. With current trunk (development version) you could add a
MailboxListener to the Mailbox and listen for Added event.


Bye,
Norman

2010/6/10 Gusnadi Kevin <gu...@ncs.com.sg>:
> Thank you for the reply Matte and Norman .
>
> I was just wondering , is it possible to make my own mailet to execute after James finished inserting a record to James inbox table ?
>
> Thanks and Regards
> Kevin
>
> -----Original Message-----
> From: norman.maurer@googlemail.com [mailto:norman.maurer@googlemail.com] On Behalf Of Norman Maurer
> Sent: Thursday, June 10, 2010 5:02 PM
> To: James Users List
> Subject: Re: About Message_Name in inbox table
>
> You could also write a Mailet which you then could call before
> LocalDelivery Mailet.
>
> Bye,
> Norman
>
>
> 2010/6/9 Gerry Matte <Ge...@shaw.ca>:
>> Hi Gusnadi.
>> If your database server supports triggers and stored procedures, you should
>> be able to associate a trigger with the james inbox table that causes a
>> procedure you create to execute - that procedure could then insert a record
>> into your table.
>> I've not tried to do that but it looks like no problem for mySql if that
>> happens to be your database server.
>> Gerry Matte
>>
>> --------------------------------------------------
>> From: "Gusnadi Kevin" <gu...@ncs.com.sg>
>> Sent: Wednesday, June 09, 2010 2:37 AM
>> To: "James Users List" <se...@james.apache.org>
>> Subject: About Message_Name in inbox table
>>
>>> Hi Guys :)
>>>
>>> I have the following problems :
>>>
>>> I'm using DB as the repository .
>>>
>>> So each times there is incoming mail to JAMES there will be record
>>> inserted to the inbox tables . for example :
>>>
>>> Message_name            repository_name    message_state
>>> blablabla.....
>>> Mail1274326357299-0 andy               root
>>> blablabla.....
>>>
>>>
>>>
>>> My problem is :
>>>
>>> - each time there is incoming mails i need to get message_name of each
>>> incoming mails record , and save it to my own table . Can anyone share
>>> some way to do it ?
>>>
>>> Or
>>>
>>> Can anyone tell me which class that JAMES use to do the insertion to the
>>> db
>>>
>>> Thanks and Regards
>>> Kevin
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>

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


RE: About Message_Name in inbox table

Posted by Gusnadi Kevin <gu...@ncs.com.sg>.
Thank you for the reply Matte and Norman .

I was just wondering , is it possible to make my own mailet to execute after James finished inserting a record to James inbox table ?

Thanks and Regards
Kevin

-----Original Message-----
From: norman.maurer@googlemail.com [mailto:norman.maurer@googlemail.com] On Behalf Of Norman Maurer
Sent: Thursday, June 10, 2010 5:02 PM
To: James Users List
Subject: Re: About Message_Name in inbox table

You could also write a Mailet which you then could call before
LocalDelivery Mailet.

Bye,
Norman


2010/6/9 Gerry Matte <Ge...@shaw.ca>:
> Hi Gusnadi.
> If your database server supports triggers and stored procedures, you should
> be able to associate a trigger with the james inbox table that causes a
> procedure you create to execute - that procedure could then insert a record
> into your table.
> I've not tried to do that but it looks like no problem for mySql if that
> happens to be your database server.
> Gerry Matte
>
> --------------------------------------------------
> From: "Gusnadi Kevin" <gu...@ncs.com.sg>
> Sent: Wednesday, June 09, 2010 2:37 AM
> To: "James Users List" <se...@james.apache.org>
> Subject: About Message_Name in inbox table
>
>> Hi Guys :)
>>
>> I have the following problems :
>>
>> I'm using DB as the repository .
>>
>> So each times there is incoming mail to JAMES there will be record
>> inserted to the inbox tables . for example :
>>
>> Message_name            repository_name    message_state
>> blablabla.....
>> Mail1274326357299-0 andy               root
>> blablabla.....
>>
>>
>>
>> My problem is :
>>
>> - each time there is incoming mails i need to get message_name of each
>> incoming mails record , and save it to my own table . Can anyone share
>> some way to do it ?
>>
>> Or
>>
>> Can anyone tell me which class that JAMES use to do the insertion to the
>> db
>>
>> Thanks and Regards
>> Kevin
>>
>> ---------------------------------------------------------------------
>> 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


RE: About Message_Name in inbox table

Posted by Gusnadi Kevin <gu...@ncs.com.sg>.
Thanks for the reply Eric and Norman 

Am I right to say that by "local delivery" means the recipient is inside
the JAMES users table ? which also means this "local delivery" is an
incoming mail ?

The reason why I want mailet to execute after the record is inserted
into the James inbox table is :

- I define my own table to store each incoming mail ( ex:
messageReceived ) , so each time there was an incoming mail , i'm using
mailet to store the necessary info for this mail to messageReceived .

Because of the above situation I need to synchronize the data in the
JAMES inbox table with the data in the messageReceived table . I am
using a foreign key in the messageReceived table so that each record
messageReceived link to one record in the JAMES inbox table .

Thanks and Regards
Kevin


-----Original Message-----
From: Eric Charles [mailto:eric.charles@u-mangate.com] 
Sent: Friday, June 11, 2010 1:43 AM
To: James Users List
Subject: Re: About Message_Name in inbox table

Hi Kevin,

If you define in spoolmanager.xml

<mailet match="All" class="MyMailet1"/>
<!-- Is the recipient is for a local account, deliver it locally -->
<mailet match="RecipientIsLocal" class="LocalDelivery"/>
<mailet match="All" class="MyMailet2"/>

you will see that MyMailet2 is not invoked for mail locally delivered, 
just because it is delivered and has no more reasons to live.

On the other hand, mail delivery occurs via jms/camel and can be 
considered "asynchronous": so you have no guarantee on the time the mail

is really inserted in the DB.
(anyone to confirm (or not) this?)

Is there any particular reason why you need a mailet after local
delivery?

Tks,

Eric

On 06/10/2010 11:22 AM, Gusnadi Kevin wrote:
> Thank you for the reply Matte and Norman .
>
> I was just wondering , is it possible to make my own mailet to execute
after James finished inserting a record to James inbox table ?
>
> Thanks and Regards
> Kevin
>
> -----Original Message-----
> From: norman.maurer@googlemail.com
[mailto:norman.maurer@googlemail.com] On Behalf Of Norman Maurer
> Sent: Thursday, June 10, 2010 5:02 PM
> To: James Users List
> Subject: Re: About Message_Name in inbox table
>
> You could also write a Mailet which you then could call before
> LocalDelivery Mailet.
>
> Bye,
> Norman
>
>
> 2010/6/9 Gerry Matte<Ge...@shaw.ca>:
>    
>> Hi Gusnadi.
>> If your database server supports triggers and stored procedures, you
should
>> be able to associate a trigger with the james inbox table that causes
a
>> procedure you create to execute - that procedure could then insert a
record
>> into your table.
>> I've not tried to do that but it looks like no problem for mySql if
that
>> happens to be your database server.
>> Gerry Matte
>>
>> --------------------------------------------------
>> From: "Gusnadi Kevin"<gu...@ncs.com.sg>
>> Sent: Wednesday, June 09, 2010 2:37 AM
>> To: "James Users List"<se...@james.apache.org>
>> Subject: About Message_Name in inbox table
>>
>>      
>>> Hi Guys :)
>>>
>>> I have the following problems :
>>>
>>> I'm using DB as the repository .
>>>
>>> So each times there is incoming mail to JAMES there will be record
>>> inserted to the inbox tables . for example :
>>>
>>> Message_name            repository_name    message_state
>>> blablabla.....
>>> Mail1274326357299-0 andy               root
>>> blablabla.....
>>>
>>>
>>>
>>> My problem is :
>>>
>>> - each time there is incoming mails i need to get message_name of
each
>>> incoming mails record , and save it to my own table . Can anyone
share
>>> some way to do it ?
>>>
>>> Or
>>>
>>> Can anyone tell me which class that JAMES use to do the insertion to
the
>>> db
>>>
>>> Thanks and Regards
>>> Kevin
>>>
>>>
---------------------------------------------------------------------
>>> 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
>
>    


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


Re: About Message_Name in inbox table

Posted by Eric Charles <er...@u-mangate.com>.
Hi Kevin,

If you define in spoolmanager.xml

<mailet match="All" class="MyMailet1"/>
<!-- Is the recipient is for a local account, deliver it locally -->
<mailet match="RecipientIsLocal" class="LocalDelivery"/>
<mailet match="All" class="MyMailet2"/>

you will see that MyMailet2 is not invoked for mail locally delivered, 
just because it is delivered and has no more reasons to live.

On the other hand, mail delivery occurs via jms/camel and can be 
considered "asynchronous": so you have no guarantee on the time the mail 
is really inserted in the DB.
(anyone to confirm (or not) this?)

Is there any particular reason why you need a mailet after local delivery?

Tks,

Eric

On 06/10/2010 11:22 AM, Gusnadi Kevin wrote:
> Thank you for the reply Matte and Norman .
>
> I was just wondering , is it possible to make my own mailet to execute after James finished inserting a record to James inbox table ?
>
> Thanks and Regards
> Kevin
>
> -----Original Message-----
> From: norman.maurer@googlemail.com [mailto:norman.maurer@googlemail.com] On Behalf Of Norman Maurer
> Sent: Thursday, June 10, 2010 5:02 PM
> To: James Users List
> Subject: Re: About Message_Name in inbox table
>
> You could also write a Mailet which you then could call before
> LocalDelivery Mailet.
>
> Bye,
> Norman
>
>
> 2010/6/9 Gerry Matte<Ge...@shaw.ca>:
>    
>> Hi Gusnadi.
>> If your database server supports triggers and stored procedures, you should
>> be able to associate a trigger with the james inbox table that causes a
>> procedure you create to execute - that procedure could then insert a record
>> into your table.
>> I've not tried to do that but it looks like no problem for mySql if that
>> happens to be your database server.
>> Gerry Matte
>>
>> --------------------------------------------------
>> From: "Gusnadi Kevin"<gu...@ncs.com.sg>
>> Sent: Wednesday, June 09, 2010 2:37 AM
>> To: "James Users List"<se...@james.apache.org>
>> Subject: About Message_Name in inbox table
>>
>>      
>>> Hi Guys :)
>>>
>>> I have the following problems :
>>>
>>> I'm using DB as the repository .
>>>
>>> So each times there is incoming mail to JAMES there will be record
>>> inserted to the inbox tables . for example :
>>>
>>> Message_name            repository_name    message_state
>>> blablabla.....
>>> Mail1274326357299-0 andy               root
>>> blablabla.....
>>>
>>>
>>>
>>> My problem is :
>>>
>>> - each time there is incoming mails i need to get message_name of each
>>> incoming mails record , and save it to my own table . Can anyone share
>>> some way to do it ?
>>>
>>> Or
>>>
>>> Can anyone tell me which class that JAMES use to do the insertion to the
>>> db
>>>
>>> Thanks and Regards
>>> Kevin
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>    


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


Re: About Message_Name in inbox table

Posted by Norman Maurer <no...@apache.org>.
You could also write a Mailet which you then could call before
LocalDelivery Mailet.

Bye,
Norman


2010/6/9 Gerry Matte <Ge...@shaw.ca>:
> Hi Gusnadi.
> If your database server supports triggers and stored procedures, you should
> be able to associate a trigger with the james inbox table that causes a
> procedure you create to execute - that procedure could then insert a record
> into your table.
> I've not tried to do that but it looks like no problem for mySql if that
> happens to be your database server.
> Gerry Matte
>
> --------------------------------------------------
> From: "Gusnadi Kevin" <gu...@ncs.com.sg>
> Sent: Wednesday, June 09, 2010 2:37 AM
> To: "James Users List" <se...@james.apache.org>
> Subject: About Message_Name in inbox table
>
>> Hi Guys :)
>>
>> I have the following problems :
>>
>> I'm using DB as the repository .
>>
>> So each times there is incoming mail to JAMES there will be record
>> inserted to the inbox tables . for example :
>>
>> Message_name            repository_name    message_state
>> blablabla.....
>> Mail1274326357299-0 andy               root
>> blablabla.....
>>
>>
>>
>> My problem is :
>>
>> - each time there is incoming mails i need to get message_name of each
>> incoming mails record , and save it to my own table . Can anyone share
>> some way to do it ?
>>
>> Or
>>
>> Can anyone tell me which class that JAMES use to do the insertion to the
>> db
>>
>> Thanks and Regards
>> Kevin
>>
>> ---------------------------------------------------------------------
>> 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: About Message_Name in inbox table

Posted by Gerry Matte <Ge...@shaw.ca>.
Hi Gusnadi.
If your database server supports triggers and stored procedures, you should 
be able to associate a trigger with the james inbox table that causes a 
procedure you create to execute - that procedure could then insert a record 
into your table.
I've not tried to do that but it looks like no problem for mySql if that 
happens to be your database server.
Gerry Matte

--------------------------------------------------
From: "Gusnadi Kevin" <gu...@ncs.com.sg>
Sent: Wednesday, June 09, 2010 2:37 AM
To: "James Users List" <se...@james.apache.org>
Subject: About Message_Name in inbox table

> Hi Guys :)
>
> I have the following problems :
>
> I'm using DB as the repository .
>
> So each times there is incoming mail to JAMES there will be record
> inserted to the inbox tables . for example :
>
> Message_name            repository_name    message_state
> blablabla.....
> Mail1274326357299-0 andy               root
> blablabla.....
>
>
>
> My problem is :
>
> - each time there is incoming mails i need to get message_name of each
> incoming mails record , and save it to my own table . Can anyone share
> some way to do it ?
>
> Or
>
> Can anyone tell me which class that JAMES use to do the insertion to the
> db
>
> Thanks and Regards
> Kevin
>
> ---------------------------------------------------------------------
> 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