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 Norman Maurer <no...@googlemail.com> on 2010/04/12 13:16:34 UTC

Re: Query - How to use JAMES and have a callback for incoming messages

Hi,

do you want to change the message before it is queued (after the DATA
SMTP command) or before it is delivered ?

Bye,
Norman


2010/4/12 Saurabh Bhatt <sa...@gmail.com>:
> I am new to JAMES and I have this query.
>
> When I receive an incoming SMTP message on the JAMES server installation,
> I want to have a callback which enables me to run some code (that may or may
> not change the message) before the message is actually stored.
>
> For example, on receiving an incoming SMTP message and before the message is
> stored in the DB for that user, I want to execute my function that checks a
> system
> limit or some arbitrary value based on which I may or may not want to store
> the msg.
>
> Thanks in advance for your help.
>
> Saurabh
>

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


Re: Query - How to use JAMES and have a callback for incoming messages

Posted by Norman Maurer <no...@googlemail.com>.
Hi,

You could write your own MessageHandler and add it to the
smtp-handlerchain.xml to get rid of the Email before it get queued
(this includes changing the mail content etc).

If you want a notification when a new mail was queued, you should just
write your own Mailet and put it on the beginning of the root
processor using the All Matcher.

http://james.apache.org/server/2.3.2/custom_mailet.html

Bye,
Norman

2010/4/12 Saurabh Bhatt <sa...@gmail.com>:
> Thanks a lot for your response.
>
> Suppose the mail delivery is local i.e. all my mailboxes are on this
> installation,
> and this is a RECV ONLY installation. I dont send any SMTP messages, just
> receive them and put them into users' mailboxes.
>
> Now when a message is received, I want to get hold of it as early as
> possible.
> What is the earliest time at which I can get such a callback?
>
> Additionally, suppose I dont want to change the message, just want a
> notification
> of a new message once it is received and deposited, with some data to be
> able
> to identify that message (get hold of the msg in one query).
> How to do that?
>
> thanks
> Saurabh
>
> On Mon, Apr 12, 2010 at 4:46 PM, Norman Maurer <norman.maurer@googlemail.com
>> wrote:
>
>> Hi,
>>
>> do you want to change the message before it is queued (after the DATA
>> SMTP command) or before it is delivered ?
>>
>> Bye,
>> Norman
>>
>>
>> 2010/4/12 Saurabh Bhatt <sa...@gmail.com>:
>> > I am new to JAMES and I have this query.
>> >
>> > When I receive an incoming SMTP message on the JAMES server installation,
>> > I want to have a callback which enables me to run some code (that may or
>> may
>> > not change the message) before the message is actually stored.
>> >
>> > For example, on receiving an incoming SMTP message and before the message
>> is
>> > stored in the DB for that user, I want to execute my function that checks
>> a
>> > system
>> > limit or some arbitrary value based on which I may or may not want to
>> store
>> > the msg.
>> >
>> > Thanks in advance for your help.
>> >
>> > Saurabh
>> >
>>
>> ---------------------------------------------------------------------
>> 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: Query - How to use JAMES and have a callback for incoming messages

Posted by Saurabh Bhatt <sa...@gmail.com>.
Thanks a lot for your response.

Suppose the mail delivery is local i.e. all my mailboxes are on this
installation,
and this is a RECV ONLY installation. I dont send any SMTP messages, just
receive them and put them into users' mailboxes.

Now when a message is received, I want to get hold of it as early as
possible.
What is the earliest time at which I can get such a callback?

Additionally, suppose I dont want to change the message, just want a
notification
of a new message once it is received and deposited, with some data to be
able
to identify that message (get hold of the msg in one query).
How to do that?

thanks
Saurabh

On Mon, Apr 12, 2010 at 4:46 PM, Norman Maurer <norman.maurer@googlemail.com
> wrote:

> Hi,
>
> do you want to change the message before it is queued (after the DATA
> SMTP command) or before it is delivered ?
>
> Bye,
> Norman
>
>
> 2010/4/12 Saurabh Bhatt <sa...@gmail.com>:
> > I am new to JAMES and I have this query.
> >
> > When I receive an incoming SMTP message on the JAMES server installation,
> > I want to have a callback which enables me to run some code (that may or
> may
> > not change the message) before the message is actually stored.
> >
> > For example, on receiving an incoming SMTP message and before the message
> is
> > stored in the DB for that user, I want to execute my function that checks
> a
> > system
> > limit or some arbitrary value based on which I may or may not want to
> store
> > the msg.
> >
> > Thanks in advance for your help.
> >
> > Saurabh
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>