Re: mail recipient listener

Juhan Aasaru <[email protected]>
Newsgroups gmane.comp.jakarta.james.user
Message-ID <CAHLXaTSx6rHjSiDAfCDjC3T_y9pDWEJ2aeK-oFiVJDUtgoOQhA@mail.gmail.com>
Hi Vijay

Yes it is possible.

Based on my experience one could solve it using a matcher and a mailet.

See the list of ready made components:
https://james.apache.org/mailet/standard/mailet-report.html
From there you should find what you are looking for. Here is an example how
to set up a matcher and a mailet:

https://github.com/apache/james-project/blob/7dfc09c6ab05cd4ddc45b1ae6963c50c9460d527/examples/custom-mailets/src/main/resources/mailetcontainer.xml#L36
The example uses custom matcher and a custom mailet but most common cases
should be solvable using the standard ones.

You only need a listener (and not a mailet) when you need to postpone your
trigger event to the moment when the email actually gets stored to a
mailbox.

James also has SMTP hools but I’m not familiar with that part of the code
base.

I hope this helps
Juhan


On Sat, 16. Oct 2021 at 14:39, Vijay Venkatasubramani <[email protected]>
wrote:

> Hello,
>
> I am working on a use case that I need to have an SMTP endpoint and
> whenever an email is sent to a particular email address, a listener should
> be invoked and process the message and call a different server. Such a
> scenario is possible with Apache James? I have seen SMTP Hooks, I am not
> sure if that serves the above requirements.
>
> Thank you
> Vijay
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.