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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class jakarta.mail.internet.MimeMessage

    cachedContent, content, contentStream, dh, flags, headers, modified, saved

    Fields inherited from class jakarta.mail.Message

    expunged, folder, msgnum, session

    Fields inherited from interface jakarta.mail.Part

    ATTACHMENT, INLINE
  • Constructor Summary

    Constructors
    Constructor
    Description
    BetterMimeMessage(jakarta.mail.internet.MimeMessage message)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returning the content of the X-Spam-Score header.
    protected boolean
     
    boolean
    Indicates if this email is automatic ou bounced .
    protected boolean
    isDeliveryStatus(String contentType)
    Indicates if the corresponding MimeType is a content-type for delivery status notifications (DSNs).
    protected boolean
    isMessageReport(String contentType)
    A multipart/report message content, as defined in RFC 3462.
    protected boolean
    isNotification(String contentType)
     
    boolean
    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, writeTo

    Methods inherited from class jakarta.mail.Message

    addRecipient, getFolder, getMessageNumber, getSession, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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.MessagingException
      Looking 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.MessagingException
      Returning 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

      public boolean isBounced() throws IOException, jakarta.mail.MessagingException
      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

      protected boolean isNotification(String contentType)
    • isDeliveryStatus

      protected boolean isDeliveryStatus(String contentType)
      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

      protected boolean isMessageReport(String contentType)
      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: