Skip to main content

account_filters

Creates, updates, deletes, gets or lists an account_filters resource.

Overview​

Nameaccount_filters
TypeResource
Idovh.email_domain.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
getselectaccount_name, domain, nameGet a filter. Returns the account, priority, active state, action (accept, account, delete or redirect) and action parameter of the filter.
listselectaccount_name, domainx_pagination_modeList filters. Returns the names of the filters of the email account. Get one to read its action, its priority and whether it is active.
createinsertaccount_name, domain, 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.
deletedeleteaccount_name, domain, 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_activityexecaccountName, domain, name, activityEnable or disable a filter. Set activity to true to apply the filter to incoming emails, or to false to suspend it.
change_priorityexecaccountName, domain, 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
accountNamestringName of account
account_namestringName of account (wire: accountName)
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"}})
domainstringName of your domain name
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.account_filters
WHERE account_name = '{{ account_name }}' -- required
AND domain = '{{ domain }}' -- 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.account_filters (
action,
action_param,
active,
header,
name,
operand,
priority,
value,
account_name,
domain
)
SELECT
'{{ action }}' /* required */,
'{{ action_param }}',
{{ active }} /* required */,
'{{ header }}' /* required */,
'{{ name }}' /* required */,
'{{ operand }}' /* required */,
{{ priority }} /* required */,
'{{ value }}' /* required */,
'{{ account_name }}',
'{{ domain }}'
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.account_filters
WHERE account_name = '{{ account_name }}' --required
AND domain = '{{ domain }}' --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.account_filters.change_activity
@accountName='{{ accountName }}' --required,
@domain='{{ domain }}' --required,
@name='{{ name }}' --required
@@json=
'{
"activity": {{ activity }}
}'
;