Next: , Previous: , Up: Library   [Contents][Index]


5.22 Compatibility Callout Functions

The following functions are wrappers over the callout functions described in the previous section. They are provided for backward compatibility.

These functions are defined in the module poll.mfl, which you must require prior to using any of them.

Library Function: boolean _pollhost (string ip, string email, string domain, string mailfrom)

Poll SMTP host ip for email address email, using domain as EHLO domain and mailfrom as MAIL FROM. Returns 0 or 1 depending on the result of the test. In contrast to the strictpoll function, this function does not use cache database and does not fall back to polling MX servers if the main poll tempfails. The function can throw one of the following exceptions: e_failure, e_temp_failure.

Library Function: boolean _pollmx (string ip, string email, string domain, string mailfrom)

Poll MXs of the domain for email address email, using domain as EHLO domain and mailfrom as MAIL FROM address. Returns 0 or 1 depending on the result of the test. In contrast to the stdpoll function, _pollmx does not use cache database and does not fall back to polling the ip if the poll fails. The function can throw one of the following exceptions: e_failure, e_temp_failure.

Library Function: boolean stdpoll (string email, string domain, string mailfrom)

Performs standard poll for email, using domain as EHLO domain and mailfrom as MAIL FROM address. Returns 0 or 1 depending on the result of the test. Can raise one of the following exceptions: e_failure, e_temp_failure.

In on statement context, it is synonymous to poll without explicit host.

Library Function: boolean strictpoll (string host, string email, string domain, string mailfrom)

Performs strict poll for email on host host. See the description of stdpoll for the detailed information.

In on context, it is synonymous to poll host host.

The mailfrom argument can be a comma-separated list of email addresses, which can be useful for servers that are unusually picky about sender addresses. It is advised, however, that this list always contain the ‘<>’ address. For example:

_pollhost($client_addr, $f, "domain", "postmaster@my.net,<>")

See also mail-from-address.

Before returning, all described functions set the following built-in variables:

VariableContains
last_poll_hostHost name or IP address of the last polled host.
last_poll_sentLast SMTP command, sent to this host. If nothing was sent, it contains literal string ‘nothing’.
last_poll_recvLast SMTP reply received from this host. In case of multi-line replies, only the first line is stored. If nothing was received the variable contains the string ‘nothing’.
cache_used1 if cached data were used instead of polling, 0 otherwise. This variable is set by stdpoll and strictpoll. If it equals 1, none of the above variables are modified. See cache_used example, for an example.

Table 5.1: Variables set by polling functions


Next: , Previous: , Up: Library   [Contents][Index]