Guido Franz ha scritto:
I want to call a James processor from outside the regular mailet context. My app (integrated into James with a Spring application context) listens to a JMS message queue and needs to do some additional processing and routing for certain messages. The 'James way' of doing this would be to call a James processor. At the moment I would use JavaMail to send a local email and start regular James handling this way, but I think it would be neater to directly call a processor. So what I need is a way to convert a MimeMessage into a mailet.Mail and start a processor. Perhaps someone can point me to a code fragment or James source class, which does a similar job?
mailetContext.sendMail is what the smtp server does after receiving the mail.
You cannot run a processor without a mailetcontext because mailet context is used by the processors.
So if are looking for a way to avoid SMTP then you can lookup the org.apache.mailet.MailetContext avalon service and then invoke its sendMail(MimeMessage msg) or sendMail(MailAddress sender, Collection recipients, MimeMessage msg).
If you also what to start the processing from a given processor then you call sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state) where state is the name of the processor.
Stefano --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]