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 Dinyar Rabady <Di...@catalysts.cc> on 2012/07/18 14:44:35 UTC

Read mails from repository regularly?

Hi!

I am currently using James to relay mails. Some of those are not relayed but stored in both a repository and as an .eml file. I would now like to be able to insert these stored mails into James again in order to be sent.

I would do this by moving the Repository objects or .emls into another folder which would be watched by James. To do so I have found the "fromRepository" Mailet. Now it isn't clear to me how this is used. Does it check the repository only at startup or after receiving an Email?

Another related question: Is it somehow possible to retrieve the name used to store the name of the stored Repository object?

Best,
Dinyar

Re: Read mails from repository regularly?

Posted by Eric Charles <er...@apache.org>.
On 07/18/2012 02:44 PM, Dinyar Rabady wrote:
> Hi!
>
> I am currently using James to relay mails. Some of those are not relayed but stored in both a repository and as an .eml file. I would now like to be able to insert these stored mails into James again in order to be sent.
>
> I would do this by moving the Repository objects or .emls into another folder which would be watched by James. To do so I have found the "fromRepository" Mailet. Now it isn't clear to me how this is used. Does it check the repository only at startup or after receiving an Email?

The FromRepository mailet is like any other mailet, it is invoked when a 
mail arrive in the spooling system of James (via SMTP).

So, you need to play with the mailetcontainer processors, e.g.:
- Define your FromRepository mailet in a processor which is invoked on 
specific condition (a mail sent to a specific address).
- All mails from the repository will be 'respooled' to the processor you 
will define.
- In that last processor, you can imagine storing the mails in yet 
another repo, or do whatever you want.

>
> Another related question: Is it somehow possible to retrieve the name used to store the name of the stored Repository object?

You mean the name of the mail? Yes, we have Mail.getName() but you will 
need to code it in your own mailet.

>
> Best,
> Dinyar
>


-- 
eric | http://about.echarles.net | @echarles


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