Class BetterMimeMessage
java.lang.Object
jakarta.mail.Message
jakarta.mail.internet.MimeMessage
org.silverpeas.components.mailinglist.service.job.BetterMimeMessage
- All Implemented Interfaces:
jakarta.mail.internet.MimePart,jakarta.mail.Part
public class BetterMimeMessage
extends jakarta.mail.internet.MimeMessage
- Author:
- ehugonnet
-
Nested Class Summary
Nested classes/interfaces inherited from class jakarta.mail.internet.MimeMessage
jakarta.mail.internet.MimeMessage.RecipientType -
Field Summary
FieldsFields inherited from class jakarta.mail.internet.MimeMessage
cachedContent, content, contentStream, dh, flags, headers, modified, savedFields inherited from class jakarta.mail.Message
expunged, folder, msgnum, sessionFields inherited from interface jakarta.mail.Part
ATTACHMENT, INLINE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatReturning the content of the X-Spam-Score header.protected booleanbooleanIndicates if this email is automatic ou bounced .protected booleanisDeliveryStatus(String contentType) Indicates if the corresponding MimeType is a content-type for delivery status notifications (DSNs).protected booleanisMessageReport(String contentType) A multipart/report message content, as defined in RFC 3462.protected booleanisNotification(String contentType) booleanisSpam()Looking for an X-Spam-Flag header in the message.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, writeToMethods inherited from class jakarta.mail.Message
addRecipient, getFolder, getMessageNumber, getSession, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
-
Field Details
-
SPAM_FLAG_HEADER
- See Also:
-
SPAM_LEVEL_HEADER
- See Also:
-
AUTO_SUBMITTED_HEADER
- See Also:
-
-
Constructor Details
-
BetterMimeMessage
public BetterMimeMessage(jakarta.mail.internet.MimeMessage message) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-
-
Method Details
-
isSpam
public boolean isSpam() throws jakarta.mail.MessagingExceptionLooking for an X-Spam-Flag header in the message.- Returns:
- true if the flag is set to YES, false otherwise.
- Throws:
jakarta.mail.MessagingException- if the message parsing fails.
-
getSpamLevel
public float getSpamLevel() throws jakarta.mail.MessagingExceptionReturning the content of the X-Spam-Score header.- Returns:
- the content of the X-Spam-Score header.
- Throws:
jakarta.mail.MessagingException- if the message parsing fails.
-
isBounced
Indicates if this email is automatic ou bounced .- Returns:
- true if this email is automatic ou bounced. False otherwise.
- Throws:
IOException- if the message content access fails.jakarta.mail.MessagingException- if the message parsing fails.
-
isAutomaticMessage
protected boolean isAutomaticMessage() throws jakarta.mail.MessagingException- Throws:
jakarta.mail.MessagingException
-
isNotification
-
isDeliveryStatus
Indicates if the corresponding MimeType is a content-type for delivery status notifications (DSNs). A DSN can be used to notify the sender of a message for several conditions: failed delivery, delayed delivery, successful delivery, or the gateway of a message into an environment that may not support DSNs. The "message/delivery-status" content-type defined herein is intended for use within the framework of the "multipart/report" content type defined. Cf. RFC 1894- Parameters:
contentType- the content-type for the mail part.- Returns:
- true if it is a content-type for delivery status.
- See Also:
-
isMessageReport
A multipart/report message content, as defined in RFC 3462. A multipart/report content is a container for mail reports of any kind, and is most often used to return a delivery status report or a disposition notification report.- Parameters:
contentType- the content-type for the mail part.- Returns:
- true if it is a content-type for delivery status.
- See Also:
-