Account level controls over outbound email, holding the sending kill switch, the rate limit rules and the sender identity mode for one account. There is at most one row per admin organisation, and no row at all means email sending is unrestricted. Every email send checks it: if disabled is true nothing is sent, otherwise each parsed rate limit rule is evaluated against how many emails the recipient, or the whole account, has received in the rule's interval. Exceeding a rule applies its actions, which can deny the send, notify the administrators, or set disabled and pause all sending for the account.
Group: Database Entities
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| adminOrg | Organisation | The account these controls apply to. There is at most one email control row per account. Never null, and lazily loaded. |
| disabled | Boolean | Whether outbound email is paused for the account. Null means not paused. This is set automatically when a rate limit rule with the pause-account action is breached, and has to be cleared by hand to resume sending. |
| id | long | Database identifier for this email control row. |
| modifiedDate | Date | Date and time the controls were last changed, including when email sending was paused automatically by a rate limit action. |
| rateLimits | String | The rate limit rules as raw text, one rule per line in the form allowed number, applies to, interval in hours and actions, separated by forward slashes. Applies to is either the word account or the name of a group, and actions is a comma separated list of pause-account, deny and notify. Use parseRateLimits to read it as objects. |
| senderMode | String | Which address outbound mail is sent as. Null, blank or k means the default behaviour, which identifies Kademi as the sender, and f means send using the from address of the email itself. |
Methods
getId() · setId(long id) · getAdminOrg() · setAdminOrg(Organisation adminOrg) · getModifiedDate() · setModifiedDate(Date modifiedDate) · getRateLimits() · setRateLimits(String rateLimits) · getSenderMode() · setSenderMode(String senderMode) · getDisabled() · setDisabled(Boolean disabled) · disabled() · parseRateLimits()
getId()
Returns: long
Database identifier for this email control row.
setId(long id)
Returns: void
Sets the database identifier. Normally only assigned by the persistence layer.
| Parameter | Description |
|---|---|
id | the primary key to assign |
getAdminOrg()
Returns: Organisation
The account these controls apply to. There is at most one email control row per account. Never null, and lazily loaded.
setAdminOrg(Organisation adminOrg)
Returns: void
Sets the account these controls apply to. Required.
| Parameter | Description |
|---|---|
adminOrg | the admin organisation the controls belong to |
getModifiedDate()
Returns: Date
Date and time the controls were last changed, including when email sending was paused automatically by a rate limit action.
setModifiedDate(Date modifiedDate)
Returns: void
Sets the date and time the controls were last changed.
| Parameter | Description |
|---|---|
modifiedDate | the last modified date |
getRateLimits()
Returns: String
The rate limit rules as raw text, one rule per line in the form allowed number, applies to, interval in hours and actions, separated by forward slashes. Applies to is either the word account or the name of a group, and actions is a comma separated list of pause-account, deny and notify. Use parseRateLimits to read it as objects.
setRateLimits(String rateLimits)
Returns: void
Sets the raw rate limit rules text. Lines that do not parse are not rejected here, they are reported by parseRateLimits instead.
| Parameter | Description |
|---|---|
rateLimits | the raw rate limit rules, one per line |
getSenderMode()
Returns: String
Which address outbound mail is sent as. Null, blank or k means the default behaviour, which identifies Kademi as the sender, and f means send using the from address of the email itself.
setSenderMode(String senderMode)
Returns: void
Sets which address outbound mail is sent as. Use k, or null, to identify Kademi as the sender, or f to send as the email's own from address.
| Parameter | Description |
|---|---|
senderMode | the sender mode code |
getDisabled()
Returns: Boolean
Whether outbound email is paused for the account. Null means not paused. This is set automatically when a rate limit rule with the pause-account action is breached, and has to be cleared by hand to resume sending.
setDisabled(Boolean disabled)
Returns: void
Pauses or resumes all outbound email for the account. Set it to false or null to resume sending.
| Parameter | Description |
|---|---|
disabled | true to pause sending, false or null to allow it |
disabled()
Returns: boolean
Whether outbound email is paused, with a null treated as not paused. Prefer this over reading the disabled property directly.
parseRateLimits()
Returns: List<RateLimit>
Parses the raw rate limits text into one RateLimit per line. Lines that do not have exactly four parts, or that have a blank or non numeric part, come back as a RateLimit carrying a parse error and no values, and such a rule has no effect when the limits are applied.