Methods Summary |
---|
public void | addRecipientDSN(javax.mail.internet.InternetHeaders h)Add deliver status notification information for another
recipient.
InternetHeaders[] rh = new InternetHeaders[recipientDSN.length + 1];
System.arraycopy(recipientDSN, 0, rh, 0, recipientDSN.length);
recipientDSN = rh;
recipientDSN[recipientDSN.length - 1] = h;
|
public javax.mail.internet.InternetHeaders | getMessageDSN()Return all the per-message fields in the delivery status notification.
The fields are defined as:
per-message-fields =
[ original-envelope-id-field CRLF ]
reporting-mta-field CRLF
[ dsn-gateway-field CRLF ]
[ received-from-mta-field CRLF ]
[ arrival-date-field CRLF ]
*( extension-field CRLF )
return messageDSN;
|
public javax.mail.internet.InternetHeaders | getRecipientDSN(int n)Return the delivery status notification information for
the specified recipient.
return recipientDSN[n];
|
public int | getRecipientDSNCount()Return the number of recipients for which we have
per-recipient delivery status notification information.
return recipientDSN.length;
|
public void | setMessageDSN(javax.mail.internet.InternetHeaders messageDSN)Set the per-message fields in the delivery status notification.
this.messageDSN = messageDSN;
|
public java.lang.String | toString()
return "DeliveryStatus: Reporting-MTA=" +
messageDSN.getHeader("Reporting-MTA", null) + ", #Recipients=" +
recipientDSN.length;
|
private static void | writeInternetHeaders(javax.mail.internet.InternetHeaders h, com.sun.mail.util.LineOutputStream los)
Enumeration e = h.getAllHeaderLines();
try {
while (e.hasMoreElements())
los.writeln((String)e.nextElement());
} catch (MessagingException mex) {
Exception ex = mex.getNextException();
if (ex instanceof IOException)
throw (IOException)ex;
else
throw new IOException("Exception writing headers: " + mex);
}
|
public void | writeTo(java.io.OutputStream os)
// see if we already have a LOS
LineOutputStream los = null;
if (os instanceof LineOutputStream) {
los = (LineOutputStream) os;
} else {
los = new LineOutputStream(os);
}
writeInternetHeaders(messageDSN, los);
los.writeln();
for (int i = 0; i < recipientDSN.length; i++) {
writeInternetHeaders(recipientDSN[i], los);
los.writeln();
}
|