worked like a charm -- thanks for an especially prompt and on-the-spot response!! :-)
On Tue, Jan 11, 2011 at 4:12 PM, Norman Maurer <[email protected]> wrote: > Hi there, > > your smtp transaction is wrong.. Try this: > > helo private.com > mail from: <[email protected]> > rcpt to: <[email protected]> > 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 <[email protected]>: > > 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: <[email protected]> > > rcpt to: <[email protected]> > > 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: [email protected] > For additional commands, e-mail: [email protected] > >
