headers.addHeaderLine((String)headerLines.nextElement());
}
ByteArrayInputStream headersIn
= new ByteArrayInputStream(headers.toByteArray());
MailImpl mail = new MailImpl(mailServer.getId(),
(MailAddress)state.get(SENDER),
(Vector)state.get(RCPT_VECTOR),
new SequenceInputStream(headersIn, msgIn));
// if the message size limit has been set, we'll
// call mail.getSize() to force the message to be
// loaded. Need to do this to enforce the size limit
if (maxmessagesize > 0) {
mail.getMessageSize();
}
mail.setRemoteHost((String)state.get(REMOTE_NAME));
mail.setRemoteAddr((String)state.get(REMOTE_IP));
mailServer.sendMail(mail);
} catch (MessagingException me) {
//Grab any exception attached to this one.
Exception e = me.getNextException();