Package net.markenwerk.utils.mail.dkim
Class DkimMessage
- java.lang.Object
-
- jakarta.mail.Message
-
- jakarta.mail.internet.MimeMessage
-
- com.sun.mail.smtp.SMTPMessage
-
- net.markenwerk.utils.mail.dkim.DkimMessage
-
public class DkimMessage extends SMTPMessage
Extension ofSMTPMessage
for the inclusion of a DKIM signature.- Since:
- 1.0.0
- Author:
- Torsten Krause (tk at markenwerk dot net), Florian Sager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jakarta.mail.internet.MimeMessage
MimeMessage.RecipientType
-
-
Field Summary
-
Fields inherited from class com.sun.mail.smtp.SMTPMessage
NOTIFY_DELAY, NOTIFY_FAILURE, NOTIFY_NEVER, NOTIFY_SUCCESS, RETURN_FULL, RETURN_HDRS
-
Fields inherited from class jakarta.mail.internet.MimeMessage
cachedContent, content, contentStream, dh, flags, headers, modified, saved
-
Fields inherited from interface jakarta.mail.Part
ATTACHMENT, INLINE
-
-
Constructor Summary
Constructors Constructor Description DkimMessage(MimeMessage message, DkimSigner signer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getEncodedBody()
Returns the encoded body.void
setAllow8bitMIME(boolean allow)
void
writeTo(OutputStream os, String[] ignoreList)
Output the message as an RFC 822 format stream, without specified headers.-
Methods inherited from class com.sun.mail.smtp.SMTPMessage
getAllow8bitMIME, getEnvelopeFrom, getMailExtension, getNotifyOptions, getReturnOption, getSendPartial, getSubmitter, setEnvelopeFrom, setMailExtension, setNotifyOptions, setReturnOption, setSendPartial, setSubmitter
-
Methods inherited from class jakarta.mail.internet.MimeMessage
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, createInternetHeaders, createMimeMessage, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isMimeType, isSet, parse, removeHeader, reply, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo
-
Methods inherited from class jakarta.mail.Message
addRecipient, getFolder, getMessageNumber, getSession, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
-
-
-
-
Constructor Detail
-
DkimMessage
public DkimMessage(MimeMessage message, DkimSigner signer) throws MessagingException
- Parameters:
message
- TheMimeMessage
to be signed.signer
- TheDkimSigner
to sign the message with.- Throws:
MessagingException
- If constructing thisDkimMessage
failed.
-
-
Method Detail
-
writeTo
public void writeTo(OutputStream os, String[] ignoreList) throws IOException, MessagingException
Output the message as an RFC 822 format stream, without specified headers. If thesaved
flag is not set, thesaveChanges
method is called. If themodified
flag is not set and thecontent
array is not null, thecontent
array is written directly, after writing the appropriate message headers. This method enhances the JavaMail methodMimeMessage.writeTo(OutputStream, String[])
See the according Sun license, this contribution is CDDL.- Overrides:
writeTo
in classMimeMessage
- Throws:
MessagingException
- If an error occurs while preparing this message for writing.IOException
- If an error occurs while writing to the stream or if an error is generated by the javax.activation layer.
-
getEncodedBody
protected String getEncodedBody()
Returns the encoded body.- Returns:
- The encoded body.
-
setAllow8bitMIME
public void setAllow8bitMIME(boolean allow)
- Overrides:
setAllow8bitMIME
in classSMTPMessage
-
-