Hi All,
I am having some problems decrypting a value in a mailet ONLY within
James. The same code works when using a test class and simple running
it, however in the event I receive an email from a specific user I get
a ClassNotFoundError in James. The following is the code I am using in
my Mailet
package hieforums;
import java.io.*;
import org.apache.mailet.*;
import security.*;
public class HIEForumsMailet extends GenericMailet
{
public boolean checkEmailValidity(String encryptedValue)
{
try
{
String decryptedValue = new DesEncrypter(new File("C:\\Program
Files\\Tomcat 5.0\\webapps\\system.dat")).decrypt(encryptedValue);
System.out.println(decryptedValue);
return true;
}
catch(IOException e)
{
e.printStackTrace();
return false;
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
return false;
}
}
public void service(Mail mail)
{
try
{
String message = mail.getMessage().getContent().toString();
String encryptedValue = message.substring(message.indexOf("��n")+3,
message.length()).replaceAll("\n", "").replaceAll("\r", "").trim();
checkEmailValidity(encryptedValue);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
Attached is the encryption class DesEncrypter. Does james restrict the
available API or uses a cut down version or something? Any help on this
would be greatly appreciated as this is a rather frustrating problem.
Kindest Regards,
Matt Anderson
DesEncrypter.java
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
