Class MailProps

    • Field Detail

      • COMPRESS

        public static final java.lang.String COMPRESS
        Property name, saved mail compression type: 0=none, 1=gzip (default), 2=xz.
        See Also:
        Constant Field Values
      • DEBUG

        public static final java.lang.String DEBUG
        Property name, debug: "debug", default false.
        See Also:
        Constant Field Values
      • QUEUED_MAIL_DIRECTORY

        public static final java.lang.String QUEUED_MAIL_DIRECTORY
        Property name: queued mail directory: "directory".
        See Also:
        Constant Field Values
      • DEFAULT_SENDER

        public static final java.lang.String DEFAULT_SENDER
        Property name, default sender: "defaultSender".
        See Also:
        Constant Field Values
      • DEFAULT_REPLYTO

        public static final java.lang.String DEFAULT_REPLYTO
        Property name, default sender: "defaultReplyTo".
        See Also:
        Constant Field Values
      • DEFAULT_CCS

        public static final java.lang.String DEFAULT_CCS
        Property name, default sender: "defaultCCs".
        See Also:
        Constant Field Values
      • DEFAULT_BCCS

        public static final java.lang.String DEFAULT_BCCS
        Property name, default sender: "defaultBCCs".
        See Also:
        Constant Field Values
      • MAIL_HOST

        public static final java.lang.String MAIL_HOST
        Property name, mail host: "host".
        See Also:
        Constant Field Values
      • PORT

        public static final java.lang.String PORT
        Property name, mail port: "port" (1-65534, default 25).
        See Also:
        Constant Field Values
      • SMTPS_PROTOCOL

        public static final java.lang.String SMTPS_PROTOCOL
        Property name, mail host: "smtps".
        See Also:
        Constant Field Values
      • USE_SSL

        public static final java.lang.String USE_SSL
        Property name: enable SSL: "ssl".
        See Also:
        Constant Field Values
      • USE_STARTTLS

        public static final java.lang.String USE_STARTTLS
        Property name: use STARTTLS: "STARTTLS".
        See Also:
        Constant Field Values
      • SERVER_IDENTITY_CHECK

        public static final java.lang.String SERVER_IDENTITY_CHECK
        Server identity check: "serverIDCheck.

        RFC 2595 specifies addition checks that must be performed on the server's certificate to ensure that the server you connected to is the server you intended to connect to. This reduces the risk of "man in the middle" attacks.

        See Also:
        Constant Field Values
      • TIMEOUT

        public static final java.lang.String TIMEOUT
        Property name, timeout in milliseconds: "timeout".
        See Also:
        Constant Field Values
      • USER_NAME

        public static final java.lang.String USER_NAME
        The user name property string: "userName" (a StringProp).
        See Also:
        Constant Field Values
      • PASSWORD

        public static final java.lang.String PASSWORD
        The password property name: "password" (a PasswordProp).
        See Also:
        Constant Field Values
    • Constructor Detail

      • MailProps

        public MailProps()
        Creates the container properties without a name.
      • MailProps

        public MailProps​(Atom atom)
        Creates the container properties with a name.
        Parameters:
        atom - The atom name.
    • Method Detail

      • getMailQueueDirectory

        public java.io.File getMailQueueDirectory​(java.io.File baseDir)
        Gets the send mail queue directory to use.
        Parameters:
        baseDir - The base directory where the server is (generally current directory).
        Returns:
        The mail directory, null for failure.
      • isDefaultSender

        public boolean isDefaultSender()
        Returns if this is the default mail sender.
        Returns:
        true if default, false otherwise.
      • getMailSender

        public MailSender getMailSender()
        Gets the current mail sender.
        Returns:
        The instance created, or null if not yet created.
      • createInstance

        public MailSender createInstance​(java.util.concurrent.ExecutorService executorService,
                                         java.io.File baseDir)
                                  throws java.io.IOException,
                                         NoSuchProviderException,
                                         AddressException
        Constructs the mail sender from the property if not already done.
        Parameters:
        executorService - The executor service.
        baseDir - The base directory where the server is (generally current directory).
        Returns:
        The instance created, or the existing one.
        Throws:
        java.io.IOException - If the mail queue directory does not exist.
        NoSuchProviderException - If the "smtp" or "smtps" providers do not exist!
        AddressException - If the default sender failed to parse.
      • verify

        public boolean verify​(PropVerification verification)
        Verifies this property container. The check performed is the extension of classes and that no circular reference is present.
        Specified by:
        verify in interface IGProp<GProp<?>[]>
        Overrides:
        verify in class PropCnr
        Parameters:
        verification - The property verification class.
        Returns:
        true if verification should proceed, false if disposed of and verification should not take place.