Class MailProps

All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
Direct Known Subclasses:
EditorMailProps

public class MailProps extends PropCnr
Container holding mail settings.
Author:
Christopher Mindus
  • Field Details Link icon

    • COMPRESS Link icon

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

      public static final String DEBUG
      Property name, debug: "debug", default false.
      See Also:
    • QUEUED_MAIL_DIRECTORY Link icon

      public static final String QUEUED_MAIL_DIRECTORY
      Property name: queued mail directory: "directory".
      See Also:
    • DEFAULT_SENDER Link icon

      public static final String DEFAULT_SENDER
      Property name, default sender: "defaultSender".
      See Also:
    • DEFAULT_REPLYTO Link icon

      public static final String DEFAULT_REPLYTO
      Property name, default sender: "defaultReplyTo".
      See Also:
    • DEFAULT_CCS Link icon

      public static final String DEFAULT_CCS
      Property name, default sender: "defaultCCs".
      See Also:
    • DEFAULT_BCCS Link icon

      public static final String DEFAULT_BCCS
      Property name, default sender: "defaultBCCs".
      See Also:
    • MAIL_HOST Link icon

      public static final String MAIL_HOST
      Property name, mail host: "host".
      See Also:
    • PORT Link icon

      public static final String PORT
      Property name, mail port: "port" (1-65534, default 25).
      See Also:
    • BIND_ADDRESS Link icon

      public static final String BIND_ADDRESS
      Property name, mail bind port, default null for none.
      See Also:
    • SMTPS_PROTOCOL Link icon

      public static final String SMTPS_PROTOCOL
      Property name, mail host: "smtps".
      See Also:
    • USE_SSL Link icon

      public static final String USE_SSL
      Property name: enable SSL: "ssl".
      See Also:
    • USE_STARTTLS Link icon

      public static final String USE_STARTTLS
      Property name: use STARTTLS: "STARTTLS".
      See Also:
    • SERVER_IDENTITY_CHECK Link icon

      public static final 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:
    • TIMEOUT Link icon

      public static final String TIMEOUT
      Property name, timeout in milliseconds: "timeout".
      See Also:
    • USER_NAME Link icon

      public static final String USER_NAME
      The user name property string: "userName" (a StringProp).
      See Also:
    • PASSWORD Link icon

      public static final String PASSWORD
      The password property name: "password" (a PasswordProp).
      See Also:
  • Constructor Details Link icon

    • MailProps Link icon

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

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

    • clone Link icon

      public MailProps clone()
      Clone must be overridden.
      Overrides:
      clone in class PropCnr
    • getMailQueueDirectory Link icon

      public File getMailQueueDirectory(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 Link icon

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

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

      public InternetAddress getDefaultSender() throws AddressException
      Gets the Default Sender.
      Returns:
      The address, or null for none.
      Throws:
      AddressException - If the address is invalid.
    • getDefaultReplyTo Link icon

      public InternetAddress getDefaultReplyTo() throws AddressException
      Gets the Default Reply To.
      Returns:
      The address, or null for none.
      Throws:
      AddressException - If the address is invalid.
    • getDefaultCCs Link icon

      public InternetAddress[] getDefaultCCs() throws AddressException
      Gets the Default CCs.
      Returns:
      The address array "never zero in length", or null for none.
      Throws:
      AddressException - If the address is invalid.
    • getDefaultBCCs Link icon

      public InternetAddress[] getDefaultBCCs() throws AddressException
      Gets the Default BCCs.
      Returns:
      The address array "never zero in length", or null for none.
      Throws:
      AddressException - If the address is invalid.
    • createInstance Link icon

      public MailSender createInstance(ExecutorService executorService, File baseDir) throws 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:
      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 Link icon

      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.