rspamd_resolver
This module allows to resolve DNS names from LUA code. All resolving is executed asynchronously. Here is an example of name resolution:
Functions:
Function | Description |
---|---|
rspamd_resolver.init(ev_base, config) |
No description |
Methods:
Method | Description |
---|---|
resolver:resolve_a(table) |
Resolve A record for a specified host. |
resolver:resolve_ptr(table) |
Resolve PTR record for a specified host. |
resolver:resolve_txt(table) |
Resolve TXT record for a specified host. |
resolver:resolve_mx(table) |
Resolve MX record for a specified host. |
resolver:resolve_ns(table) |
Resolve NS records for a specified host. |
resolver:idna_convert_utf8(hostname[, pool]) |
Converts domain name from IDN (in utf8 format) to punycode. |
The module rspamd_resolver
defines the following functions.
rspamd_resolver.init(ev_base, config)
Parameters:
ev_base {event_base}
: event base used for asynchronous eventsconfig {rspamd_config}
: rspamd configuration parametersReturns:
{rspamd_resolver}
: new resolver object associated with the specified baseBack to module description.
The module rspamd_resolver
defines the following methods.
resolver:resolve_a(table)
Resolve A record for a specified host. Table elements:
task
- task element (preferred, required to track dependencies) -or-session
- asynchronous session normally associated with rspamd task (task:get_session()
)mempool
- pool memory pool for storing intermediate dataname
- host name to resolvecallback
- callback callback function to be called upon name resolution is finished; must be of type function (resolver, to_resolve, results, err)
forced
- true if needed to override normal limit for DNS requestsParameters:
No parameters
Returns:
{boolean}
: true
if DNS request has been scheduledBack to module description.
resolver:resolve_ptr(table)
Resolve PTR record for a specified host. Table elements:
task
- task element (preferred, required to track dependencies) -or-session
- asynchronous session normally associated with rspamd task (task:get_session()
)mempool
- pool memory pool for storing intermediate dataname
- host name to resolvecallback
- callback callback function to be called upon name resolution is finished; must be of type function (resolver, to_resolve, results, err)
forced
- true if needed to override normal limit for DNS requestsParameters:
No parameters
Returns:
{boolean}
: true
if DNS request has been scheduledBack to module description.
resolver:resolve_txt(table)
Resolve TXT record for a specified host. Table elements:
task
- task element (preferred, required to track dependencies) -or-session
- asynchronous session normally associated with rspamd task (task:get_session()
)mempool
- pool memory pool for storing intermediate dataname
- host name to resolvecallback
- callback callback function to be called upon name resolution is finished; must be of type function (resolver, to_resolve, results, err)
forced
- true if needed to override normal limit for DNS requestsParameters:
No parameters
Returns:
{boolean}
: true
if DNS request has been scheduledBack to module description.
resolver:resolve_mx(table)
Resolve MX record for a specified host. Table elements:
task
- task element (preferred, required to track dependencies) -or-session
- asynchronous session normally associated with rspamd task (task:get_session()
)mempool
- pool memory pool for storing intermediate dataname
- host name to resolvecallback
- callback callback function to be called upon name resolution is finished; must be of type function (resolver, to_resolve, results, err)
forced
- true if needed to override normal limit for DNS requestsParameters:
No parameters
Returns:
{boolean}
: true
if DNS request has been scheduledBack to module description.
resolver:resolve_ns(table)
Resolve NS records for a specified host. Table elements:
task
- task element (preferred, required to track dependencies) -or-session
- asynchronous session normally associated with rspamd task (task:get_session()
)mempool
- pool memory pool for storing intermediate dataname
- host name to resolvecallback
- callback callback function to be called upon name resolution is finished; must be of type function (resolver, to_resolve, results, err)
forced
- true if needed to override normal limit for DNS requestsParameters:
No parameters
Returns:
{boolean}
: true
if DNS request has been scheduledBack to module description.
resolver:idna_convert_utf8(hostname[, pool])
Converts domain name from IDN (in utf8 format) to punycode
Parameters:
No parameters
Returns:
{string}
: new name convertedBack to module description.
Back to top.