badpenguin.dkim
Class MailMessage

java.lang.Object
  extended by badpenguin.dkim.MailMessage

public class MailMessage
extends java.lang.Object

This simple class reads in a raw email message streams and stores the headers and body in separate ByteArrayOutputStream variables for processing by the other DKIM objects.

Author:
Mark Boddington <dk_NO_im@_SP_bad_AM_penguin.co.uk>
http://www.badpenguin.co.uk

Constructor Summary
MailMessage()
          Default constructor.
 
Method Summary
 int dkimHeaderCount()
          Return the number of DKIM Signatures found in this mail message
 int domkeyHeaderCount()
          Return the number of DomainKey Signatures found in this mail message
 java.io.ByteArrayOutputStream getBody()
          Return the body data which was stored during the last processMail() invocation.
 java.io.ByteArrayOutputStream getHeaders()
          Return the headers which were stored during the last processMail() invocation.
 void processMail(java.io.InputStream msg)
          This method performs most of the input processing of the raw mail messages.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailMessage

public MailMessage()
Default constructor. Returns an empty MailMessage object.

Method Detail

processMail

public void processMail(java.io.InputStream msg)
This method performs most of the input processing of the raw mail messages. We initialise the ByteArrayOutputStreams and parse the message provided in the InputStream. Once parsed, the headers and body data can be retrieved by calling the appropriate methods.

Parameters:
msg - - The raw email message as an InputStream

getHeaders

public java.io.ByteArrayOutputStream getHeaders()
Return the headers which were stored during the last processMail() invocation.

Returns:
The header stream

getBody

public java.io.ByteArrayOutputStream getBody()
Return the body data which was stored during the last processMail() invocation.

Returns:
The body data stream

dkimHeaderCount

public int dkimHeaderCount()
Return the number of DKIM Signatures found in this mail message

Returns:
number of signatures

domkeyHeaderCount

public int domkeyHeaderCount()
Return the number of DomainKey Signatures found in this mail message

Returns:
number of signatures


© Copyright 2009 Mark Boddington (www.badpenguin.co.uk)