Hi there, your smtp transaction is wrong.. Try this:
helo private.com mail from: <x...@private.com> rcpt to: <x...@private.com> data Subject: test test . quit Let me know if it work.. As noted in the RFC headers and body need to be seperated by CRLFCRLF. Bye, Norman 2011/1/11 agks mehx <agksm...@gmail.com>: > Hi, > > I cannot access the text content of a simple text/plain email sent to the > James SMTP server. This is my first mailet and I got the same problem with > M2 and a recent M3-snapshot. > > The following is the most simplified version of the source. The following > code returns an *empty string*: String content = > (String)mime_message.getContent(); > > After running the server, I telnet to port 25 and copy paste the following > commands: > > helo private.com > mail from: <x...@private.com> > rcpt to: <x...@private.com> > data > test > . > quit > > Source of mailet follows: > > package com.private.main.mailet; > > import java.io.IOException; > > import javax.mail.MessagingException; > import javax.mail.internet.MimeMessage; > > import org.apache.mailet.Mail; > import org.apache.mailet.Mailet; > import org.apache.mailet.MailetConfig; > > public class Test implements Mailet { > > protected MailetConfig mailet_config; > > public void init (MailetConfig mailet_config) { > this.mailet_config = mailet_config; > } > > public void destroy () { > } > > public MailetConfig getMailetConfig () { > return this.mailet_config; > } > > public String getMailetInfo () { > return "Test Mailet"; > } > > public void service (Mail mail) throws MessagingException { > try { > MimeMessage mime_message = mail.getMessage(); > mail.setState(Mail.GHOST); > System.out.println("content_type: " + mime_message.getContentType()); > if (mime_message.isMimeType("text/plain")) { > String content = (String)mime_message.getContent(); > System.out.println(content); > } > } catch (IOException e) { > System.err.println("got an IOException:"); > e.printStackTrace(); > } > } > > } > > Thanks for any help! > --------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org