Hi all.
Since I had nothing planned for this evening I thought I�d try to write my
first mailet wich matches on a certain SubjectIs. Since I don�t know how to
write a nice mailet I stole a snippet from Serge�s ServerTime mailet just to
see if I could get his code working in my mailet. Wich I couldn�t... My code
looks like this:
public void service(Mail mail) throws MessagingException
{
MimeMessage response = (MimeMessage)mail.getMessage().reply(false);
response.setSubject("The time is now...");
StringBuffer textBuffer =
new StringBuffer(128)
.append("This mail server thinks it's ")
.append((new java.util.Date()).toString())
.append(".");
response.setText(textBuffer.toString());
Set recipients = new HashSet();
Address addresses[] = response.getAllRecipients();
for (int i = 0; i < addresses.length; i++) {
recipients.add(new MailAddress((InternetAddress)addresses[0]));
}
MailAddress sender = new MailAddress("[EMAIL PROTECTED]"); //My
changes!!!
getMailetContext().sendMail(sender, recipients, response);
}
and then spoolmanager says like this :
03/02/03 18:04:13 ERROR spoolmanager.root: Exception calling SvanteTest:
Exception spooling message: Exception caught while storing Message
Container: javax.activation.UnsupportedDataTypeException: no object DCH for
MIME type text/plain; charset=us-ascii;
nested exception is:
java.lang.RuntimeException: Exception caught while storing Message
Container: javax.activation.UnsupportedDataTypeException: no object DCH for
MIME type text/plain; charset=us-ascii
javax.mail.MessagingException: Exception spooling message: Exception caught
while storing Message Container:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
text/plain; charset=us-ascii;
nested exception is:
java.lang.RuntimeException: Exception caught while storing Message
Container: javax.activation.UnsupportedDataTypeException: no object DCH for
MIME type text/plain; charset=us-ascii
at org.apache.james.James.sendMail(James.java:450)
at org.apache.james.James.sendMail(James.java:407)
at org.apache.james.James.sendMail(James.java:389)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invo
ke(BlockInvocationHandler.java:92)
at $Proxy9.sendMail(Unknown Source)
at
org.apache.james.transport.mailets.SvanteTest.service(SvanteTest.java:98)
at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:362)
at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:
385)
at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:315)
at
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Executabl
eRunnable.java:47)
at
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:8
0)
java.lang.RuntimeException: Exception caught while storing Message
Container: javax.activation.UnsupportedDataTypeException: no object DCH for
MIME type text/plain; charset=us-ascii
at
org.apache.james.mailrepository.AvalonMailRepository.store(AvalonMailReposit
ory.java:305)
at org.apache.james.James.sendMail(James.java:444)
at org.apache.james.James.sendMail(James.java:407)
at org.apache.james.James.sendMail(James.java:389)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invo
ke(BlockInvocationHandler.java:92)
at $Proxy9.sendMail(Unknown Source)
at
org.apache.james.transport.mailets.SvanteTest.service(SvanteTest.java:98)
at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:362)
at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:
385)
at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:315)
at
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Executabl
eRunnable.java:47)
at
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:8
0)
03/02/03 18:04:13 ERROR spoolmanager: Exception in processor <root>
javax.mail.MessagingException: Exception spooling message: Exception caught
while storing Message Container:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
text/plain; charset=us-ascii;
nested exception is:
java.lang.RuntimeException: Exception caught while storing Message
Container: javax.activation.UnsupportedDataTypeException: no object DCH for
MIME type text/plain; charset=us-ascii
at org.apache.james.James.sendMail(James.java:450)
at org.apache.james.James.sendMail(James.java:407)
at org.apache.james.James.sendMail(James.java:389)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invo
ke(BlockInvocationHandler.java:92)
at $Proxy9.sendMail(Unknown Source)
at
org.apache.james.transport.mailets.SvanteTest.service(SvanteTest.java:98)
at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:362)
at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:
385)
at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:315)
at
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Executabl
eRunnable.java:47)
at
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:8
0)
03/02/03 18:04:13 ERROR spoolmanager: An error occurred processing
Mail1044291852622-1 through root
03/02/03 18:04:13 ERROR spoolmanager: Result was error
My James version is 2.1.1a5 (local build with my mailet in it). Os is W2k
and client Outlook 2000. I had a look in the mail archive but I didn�t find
anything I could use. So, if someone knows how to get a DCH for the
text/plain MIME type I�ll be more than happy to listen!
Regards
Svante
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]