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

5.34 Special Test Functions

Library Function: boolean portprobe (string host, [number port])
Library Function: boolean listens (string host, [number port])

Returns true if the IP address or host name given by host argument listens on the port number port (default 25).

This function is defined in the module portprobe.

Built-in Function: boolean validuser (string name)

Returns true if authenticity of the user name is confirmed using mailutils authentication system. See Local Account Verification, for more details.

Library Function: boolean valid_domain (string domain)

Returns true if the domain name domain has a corresponding A record or if it has any ‘MX’ records, i.e. if it is possible to send mail to it.

To use this function, require the valid_domain module (see Modules):

require valid_domain
Library Function: number heloarg_test (string arg, string remote_ip, string local_ip)

Verify if an argument of ‘HELO’ (‘EHLO’) command is valid. To use this function, require the heloarg_test module (see Modules).



HELO’ (‘EHLO’) argument. Typically, the value of $s Sendmail macro;


IP address of the remote client. Typically, the value of $client_addr Sendmail macro;


IP address of this SMTP server;

The function returns a number describing the result of the test, as described in the following table.

HELO_SUCCESSarg successfully passes all tests.
HELO_MYIParg is our IP address.
HELO_IPNOMATCHarg is an IP, but it does not match the remote party IP address.
HELO_ARGNORESOLVEarg is an IP, but it does not resolve.
HELO_ARGNOIParg is in square brackets, but it is not an IP address.
HELO_ARGINVALIDarg is not an IP address and does not resolve to one.
HELO_MYSERVERIParg resolves to our server IP.
HELO_IPMISMATCHarg does not resolve to the remote client IP address.

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