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 Scherer Pierre <sc...@ibelgique.com> on 2003/11/25 20:27:21 UTC

Jaf and James

Hi,

I try to use Jaf with James! In fact, I would like catching some
MimeMessages in mails that transit by james in fonction of the Mime
type! I know that I must write the frameworks defines in the JavaMail
API (DataHandler,...) but I don't know where I must include this files
in James (In fact where does James make operations on the MimeMessage).

If someone has already doing that, can he tell me how I must organise my
files please!

Thank you

Pierre
--------------------------------------
Scherer Pierre 
scherer_pierre@ibelgique.com
http://users.skynet.be/scherer_pierre/ 




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


Re: RE : Jaf and James

Posted by Serge Knystautas <se...@lokitech.com>.
Scherer Pierre wrote:
> In fact, the it is a S/MIME message warpped in the the body of the mail
> and the javas class that decryptic this messages already exist and use
> Jaf.
> I would like know if it is possible that when mails cross processors (in
> spoolmanager), mails can be already décryptic by my classes using Jaf
> (work take place automaticely if I place the good DataHandler in the
> good file).

Ok, if that's the case, you can follow the rules in the the JAF 
Javadocs, specifically

http://java.sun.com/products/javabeans/glasgow/javadocs/javax/activation/MailcapCommandMap.html

So, you might just want to edit the mailcap file yourself, but it would 
be cool to plug it in nicely into James.  If you do figure out the 
latter, please let us know.

I would add though that each trip through a processor will cause the 
MimeMessage to be reparsed.  James does not keep the message in memory 
and tries to avoid loading it at all until required.

> Sorry for my english :-(

No problem.  It's my first language, but I still have problems.

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


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


RE : Jaf and James

Posted by Scherer Pierre <sc...@ibelgique.com>.
In fact, the it is a S/MIME message warpped in the the body of the mail
and the javas class that decryptic this messages already exist and use
Jaf.
I would like know if it is possible that when mails cross processors (in
spoolmanager), mails can be already décryptic by my classes using Jaf
(work take place automaticely if I place the good DataHandler in the
good file).

Sorry for my english :-(


-Pierre

>I'm not completely sure what you're trying to do, but assuming you want

>to provide a custom DataHandler to give you a particular Object when
you 
>call MimeMessage.getContent(), you can programmatically register 
>additional mime-type -> data handler's.
>
>This seems overkill though... wouldn't it just be easier to do this 
>manually, i.e., in your mailet check for a mime-type, and if it matches

>one of the ones you want to parse, call getInputStream() and parse 
>accordingly?

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


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

_____________________________________________________________________
Un mot doux à envoyer? Une sortie ciné à organiser? Faites le en temps
réel avec MSN Messenger! C'est gratuit!   http://ifrance.com/_reloc/m


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


Re: Jaf and James

Posted by Serge Knystautas <se...@lokitech.com>.
Scherer Pierre wrote:
> I try to use Jaf with James! In fact, I would like catching some
> MimeMessages in mails that transit by james in fonction of the Mime
> type! I know that I must write the frameworks defines in the JavaMail
> API (DataHandler,...) but I don't know where I must include this files
> in James (In fact where does James make operations on the MimeMessage).
> 
> If someone has already doing that, can he tell me how I must organise my
> files please!

I'm not completely sure what you're trying to do, but assuming you want 
to provide a custom DataHandler to give you a particular Object when you 
call MimeMessage.getContent(), you can programmatically register 
additional mime-type -> data handler's.

This seems overkill though... wouldn't it just be easier to do this 
manually, i.e., in your mailet check for a mime-type, and if it matches 
one of the ones you want to parse, call getInputStream() and parse 
accordingly?

-- 
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com


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