Package org.jgrapes.mail


package org.jgrapes.mail
Components for handling mail.

The components are based on the Jakarta Mail API.

All components handle ConfigurationUpdate events. They process properties from three paths:

  1. /org.jgrapes.mail/Component
  2. /org_jgrapes_mail/Component
  3. /org.jgrapes.mail/ + component class name
  4. /org_jgrapes_mail/ + component class name
  5. The path return by Manager.componentPath()

With the properties from the later sources taking precedence.

In each source, there can be a sub-section “.../mail”. The valid keys in this sub-section are all properties defined for Jakarta Mail with the prefix “mail.” removed to avoid unnecessary redundancy.

The additional key/value defined with the paths above are used to call the respective setter methods of the component.

Example configuration using JsonConfigurationStore:

{
    "/org.jgrapes.mail": {
        "/Component": {
            "/mail": {
                "user": "..."
            },
            "password": "..."
        },
        "/MailMonitor": {
            "/mail": {
                "host": "...",
                "store.protocol": "imap",
                "imap.ssl.enable": "true",
                "imap.port": 993
            }
        },
        "/MailSender": {
            "/mail": {
                "host": "...",
                "transport.protocol": "smtp",
                "smtp.ssl.enable": "true",
                "smtp.port": 465,
                "smtp.auth": true
            }
        }
    }
}