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 Jason Proctor <ja...@redfish.net> on 2006/03/17 18:08:41 UTC

code breakage - James environment question

hey guys,

i just started using James to do some custom mail forwarding and i'm 
running into a problem which seems to be confined to the James 
environment.

my project is in stealth mode so i can't give too many details away.

however i can say that our application involves a decent chunk of 
crypto, my mailet intercepts every message routed to James, and the 
mailet code works fine if i invoke it from another environment. ie, i 
wrote a command line tool which pretends to be James and calls my 
mailet.

our API, which the mailet calls, is pretty solid, having been tested 
by our clients and test scripts and all that. my attempts at 
debugging the problem so far haven't produced any results - the path 
through the code seems to be identical.

so my questions are -- is there anything weird about the James 
environment from a coding standpoint? are there things that should 
not be done from a mailet?

any help appreciated.

tx
jason

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


Re: code breakage - James environment question

Posted by Stefano Bagnara <ap...@bago.org>.
Jason Proctor wrote:
> i'm protecting a session (blowfish) key with PKCS (RSA). the key 
> generation and encryption happen without incident, but at the other end, 
> the blowfish key does not successfully decrypt. in parallel runs of a 
> working client and the mailet, i confirmed that the RSA public key used 
> by both clients are identical, and that the algorithms used for the 
> blowfish stuff are identical. i explicitly install the security provider 
> in position zero at mailet init() time, but i'm starting to think that 
> james is overriding my choice of security provider. consequently the 
> stream formats between the providers are not compatible and i end up 
> with a padding error on unstream time.

In James 2.2.0 there is no code about SecurityProviders so it should not 
be the case.

Do you use the same JVM for James and for your other tests?

Stefano


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


Re: code breakage - James environment question

Posted by Jason Proctor <ja...@redfish.net>.
hi stefano,

thanks for the quality info.

>What release of James are you using?

2.2.0

>And what is the problem? An exception? A different behaviour? What?

i'm protecting a session (blowfish) key with PKCS (RSA). the key 
generation and encryption happen without incident, but at the other 
end, the blowfish key does not successfully decrypt. in parallel runs 
of a working client and the mailet, i confirmed that the RSA public 
key used by both clients are identical, and that the algorithms used 
for the blowfish stuff are identical. i explicitly install the 
security provider in position zero at mailet init() time, but i'm 
starting to think that james is overriding my choice of security 
provider. consequently the stream formats between the providers are 
not compatible and i end up with a padding error on unstream time.

i have a workaround in the form of a mini-SMTP server i wrote which 
just calls us, but if possible i'd like to nail this problem down.

any help appreciated.

thanks,
jason


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


Re: code breakage - James environment question

Posted by Stefano Bagnara <ap...@bago.org>.
Jason Proctor wrote:
> however i can say that our application involves a decent chunk of 
> crypto, my mailet intercepts every message routed to James, and the 
> mailet code works fine if i invoke it from another environment. ie, i 
> wrote a command line tool which pretends to be James and calls my mailet.

What release of James are you using?
James 2.3.0 includes crypto mailets and it does explicitly set the 
preferred key stores and something similar. This may conflict with your 
code...

> our API, which the mailet calls, is pretty solid, having been tested by 
> our clients and test scripts and all that. my attempts at debugging the 
> problem so far haven't produced any results - the path through the code 
> seems to be identical.

And what is the problem? An exception? A different behaviour? What?

> so my questions are -- is there anything weird about the James 
> environment from a coding standpoint? are there things that should not 
> be done from a mailet?

No. The only thing is that mailets must be threadsafe.

James 2.3.0a1 (James-trunk) uses a different way to provide classloader 
for mailets than James 2.2.0.

Stefano


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