Content-type: text/html Manpage of chkmadd

chkmadd

Section: Networking Tools (1)
Updated: 12 JUNE 2006
Index Return to Main Contents

 

NAME

chkmadd - CHecK Mail ADDress

 

SYNOPSIS

chkmadd [OPTION]... EMAIL_ADDRESS...

 

DESCRIPTION

chkmadd verifies EMAIL_ADDRESS(es) by retrieving the mail exchangers (MXs) for their domain part(s) with host(1) and grep(1), and accessing them via SMTP telnet(1). From version 0.1.2.2004062116 on, it also tries the A record of all domains part(s) if no MX record for either domain is present.

From version 0.1.2.2004021702 on, this program supports an expect(1) script for talking SMTP to MXs automagically. That script is specified as follows (key words in uppercase letters are to be interpreted as described in RFC 2119):

It MUST take up to three arguments. The first two arguments, specifying the MX and the e-mail address to be verified, MUST be mandatory, i.e. the script MUST exit with a status greater than 2 if one or both are missing. The third argument MAY optionally specify the default timeout in seconds. If the script does not handle an option (i.e. an argument starting with "-"), it MUST ignore it. It MUST exit with a status of 0 if the e-mail address could be verified positive and an exit status of 1 if not. It MAY exit with a status of 2 to indicate that it is not known whether the passed string specifies a mailbox on this server. It MUST exit with a status greater than 2 if other errors occur. It MAY generate arbitrary output in either case. It MUST NOT affect the execution of calling programs directly.

Builds 2004022414 and later of the chkmadd.exp(3) script contained in the distribution meet the argument and exit status requirements. (They do not meet the requirements for options yet; however, that is a requirement for further customization of the address checks. TODO, see below.)

If expect(1) or the script described above is not available, you are required to type SMTP commands for verification (see RFC 2821, especially the VRFY, MAIL, HELO and RCPT commands.) Note that you SHOULD NOT use this script in a non-interactive environment in this case. telnet(1) may time out but the delay could interrupt that environment, and you will receive no useful feedback anyway. Use the -a option to prevent that.
(NOTE: It should be reconsidered whether the script is reasonable to use then. Maybe the whole thing should be written in Expect. That would also allow to remove the dependency on other networking tools; however on the other hand, it would require implementing several network protocols in Expect, not only basic SMTP.)

From version 0.1.4.2005010914 on, this script is going to support a chkmadd server to listen for incoming requests if the chkmadd.exp(1) program can be executed on that server. See the -l and -s options for details. (TODO)

 

OPTIONS

-a, --auto
Force automatic verification via the expect(1) SCRIPT. If the expect(1) program or the SCRIPT is not available, returns with exit status 2 for all addresses. (TODO)

-d, --force-dupes
Force MXs with different host name but same IP address to be asked for EMAIL_ADDRESS. This is a TODO; the current behavior is to ask every MX regardless of the resolved IP address.

-E, --expect PROGRAM
Specify the expect(1) PROGRAM to be used. The default is /usr/bin/expect.

-e, --expect-script SCRIPT
Specify the expect(1) SCRIPT to be used. The default is
chkmadd.exp(1) in the chkmadd program directory.

-f, --file [FILE]
Read EMAIL_ADDRESS(es) from FILE. The default is the standard input which can be equally specified as `-'.

-H, --force-helo
Force HELO command. RFC 2821 does not require a client to send HELO, and the default is not to send it unless MAIL FROM fails; in fact, the RFC says that `HELO' SHOULD NOT be required for further protocol communication. However, some broken/suspicious configured MTAs (like ESMTP) will terminate the connection when receiving MAIL FROM or RCPT TO without previous HELO (this is usually paraphrased as and sometimes even responded with "Polite people say HELO.") (TODO)

-h, --help
Display this help screen and exit with status 127.

-l, --listen
Listen for parameters from stdin or on the PORT specified with -p. Corresponds remotely with the locally given -s option. To prevent misuse, this works together with -p only if the SERVER provides both expect(1) and the chkmadd.exp(1) program, i.e. -a is given implicitly. (TODO)
        
-p, --port PORT
Specify the port where either requests should be addressed to (-s) or where the chkmadd SERVER should listen on (-l). The default is telnet(23)/tcp.
This option overrides the CHKMADD_PORT environment variable (see below). Specify `-p -' for the default port. (TODO)

-s, --server SERVER
Specify a chkmadd SERVER to which the request is being forwarded by the local program. Introduced primarily to allow clients within blacklisted IP address ranges (such as computers of dial-up users having dynamic IP addresses) to use servers that are not blacklisted. A chkmadd server is a server which can be reached via ssh(1) and has both chkmadd and (as a security precaution) expect(1) installed.
This option overrides the CHKMADD_SERVER environment variable (see below). Use `-s -' to make sure that a so predefined SERVER is NOT used. (TODO)

-t, --timeout SECONDS
Specify the number of seconds the expect(1) SCRIPT should wait for a server reponse to a command before trying the next alternative (or abort if there are no more alternatives). The default is 10. Use values greater than 20 for slow connections/servers.

-V, --version
Display version information and exit with status 127.

-v, --verbose
Be verbose.

-y, --no-vrfy
Skip VRFY command. Some completely b0rken MTAs are already offended by VRFY before HELO/MAIL FROM, and terminate the connection, or respond with an invalid status code then. That would confuse chkmadd.exp(1) and return false negatives, which can be prevented by using this option. (TODO)

EMAIL_ADDRESS
E-mail address to be verified. May be delimited by `<' and `>'. Separate e-mail addresses by space ($IFS in general).

 

EXIT CODES

0
Address verification positive or version info successfully retrieved

1
No address

2
Unable to verify address

3
No address: all specified MXs are invalid

127
General error

 

ENVIRONMENT

CHKMADD_PORT
Specifies the PORT to be used by default. If set, -p is given implicitly. (TODO)

CHKMADD_SERVER
Specifies the chkmadd SERVER to be used by default. If set, -s is given implicitly. (TODO)

TERM
If not `raw' and stty(1) returns the size, use colored output with ANSI escape sequences.

 

FILES

/usr/bin/expect
Default location of the expect(1) program.
./chkmadd.exp
Default location of the chkmadd.exp(1) script.

 

SEE ALSO

host(1), grep(1), telnet(1)

RFC 2119 -- Key words for use in RFCs to Indicate Requirement Levels, S. Bradner, March 1997. <http://www.ietf.org/rfc/rfc2119.txt>

RFC 2821 -- Simple Mail Transfer Protocol (SMTP), J. Klensin, April 2001. <http://www.ietf.org/rfc/rfc2821.txt>

expect(1) <http://expect.nist.gov/>, chkmadd.exp(1)

 

BUGS

None known. Please report bugs to <chkmadd@PointedEars.de>.

 

NOTES

Tested with GNU/Linux 2.4.25/6/9/.30 [1] (Knoppix 3.4 [2] and Debian 3.x [3] Testing/Unstable), and Cygwin 1.5.9-1 and 1.5.10(0.116/4/2) [4] on Microsoft Windows 2000 Professional, Service Pack 4 [5].

[1] <http://kernel.org/>
[2] <http://knopper.net/knoppix/>
[3] <http://debian.org/>
[4] <http://cygwin.com/>
[5] <http://www.microsoft.com/windows2000/>

 

LEGAL NOTICE

Copyright (c) 2003-2006 Thomas Lahn <mehl@PointedEars.de>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License (GPL) for more details.

You should have received a copy of the GNU GPL along with this program (COPYING file); if not, go to [1] or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

[1] <http://www.gnu.org/licenses/licenses.html#GPL>


--
Standard shell script disclaimer blurb thing:

This script is a hack. It's brute force. It's horrible. It doesn't use Artificial Intelligence. It doesn't use Virtual Reality. It's not perl. It's not python. It probably won't work unchanged on the "other" thousands of unices. But it worksforme. --ramiro
(from /usr/local/mozilla/run-mozilla.sh)

 

CREDITS

Thanks to Christoph 'Mehdorn' Weber <ich-reweb@gmx.net> for test cases and to Don Libes <libes@nist.gov> for the great expect(1) tool.

 

AVAILABILITY

The author's latest version can be obtained from
<http://PointedEars.de/tools/network/chkmadd/>.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXIT CODES
ENVIRONMENT
FILES
SEE ALSO
BUGS
NOTES
LEGAL NOTICE
CREDITS
AVAILABILITY

This document was created by man2html, using the manual pages.
Time: 13:26:49 GMT, June 23, 2008