Skip to main content

delegated_account_filters

Creates, updates, deletes, gets or lists a delegated_account_filters resource.

Overview​

Namedelegated_account_filters
TypeResource
Idovh.email_domain.delegated_account_filters

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringFilter name
actionstringAction of filter (accept, account, delete, redirect)
action_paramstringAction parameter of filter (wire: actionParam)
activebooleanIf true filter is active
domainstringDomain name of filter
popstringAccount name of filter
priorityintegerPriority of filter

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectemail, nameGet a filter. Returns the account, priority, active state, action (accept, account, delete or redirect) and action parameter of the filter.
listselectemailx_pagination_modeList filters. Returns the names of the filters of the delegated email account. Get one to read its action, priority and state.
createinsertemail, action, active, header, name, operand, priority, valueCreate a filter. Creates a filter with a rule on a header (operand and value), an action, a priority and an active state, and returns the task.
deletedeleteemail, nameDelete a filter. Removes the filter and its rules from the email account, and returns the tasks. Incoming emails are no longer filtered by it.
change_activityexecemail, name, activityEnable or disable a filter. Set activity to true to apply the filter to incoming emails, or to false to suspend it.
change_priorityexecemail, name, priorityChange filter priority. Sets the priority of the filter, which gives the order the filters of the account are applied in.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
emailstringEmail
namestringFilter name
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get a filter. Returns the account, priority, active state, action (accept, account, delete or redirect) and action parameter of the filter.

SELECT
name,
action,
action_param,
active,
domain,
pop,
priority
FROM ovh.email_domain.delegated_account_filters
WHERE email = '{{ email }}' -- required
AND name = '{{ name }}' -- required
;

INSERT examples​

Create a filter. Creates a filter with a rule on a header (operand and value), an action, a priority and an active state, and returns the task.

INSERT INTO ovh.email_domain.delegated_account_filters (
action,
action_param,
active,
header,
name,
operand,
priority,
value,
email
)
SELECT
'{{ action }}' /* required */,
'{{ action_param }}',
{{ active }} /* required */,
'{{ header }}' /* required */,
'{{ name }}' /* required */,
'{{ operand }}' /* required */,
{{ priority }} /* required */,
'{{ value }}' /* required */,
'{{ email }}'
RETURNING
id,
account,
action,
domain,
timestamp
;

DELETE examples​

Delete a filter. Removes the filter and its rules from the email account, and returns the tasks. Incoming emails are no longer filtered by it.

DELETE FROM ovh.email_domain.delegated_account_filters
WHERE email = '{{ email }}' --required
AND name = '{{ name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Enable or disable a filter. Set activity to true to apply the filter to incoming emails, or to false to suspend it.

EXEC ovh.email_domain.delegated_account_filters.change_activity
@email='{{ email }}' --required,
@name='{{ name }}' --required
@@json=
'{
"activity": {{ activity }}
}'
;