chkmadd(1) Networking Tools chkmadd(1) 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, speci- fying the MX and the e-mail address to be verified, MUST be manda- tory, i.e. the script MUST return an exit code greater than 2 if one or both are missing. The third argument MAY optionally specify the default timeout in seconds. If it does not handle an option (i.e. an argument starting with "-"), it MUST ignore it. It MUST return an exit code of 0 if the e-mail address could be verified positive and an exit code of 1 if not. It MAY return an exit code of 2 to indicate that it is not known whether the passed string specifies a mailbox on this server. It MUST return an exit code 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 these requirements. If expect(1) or the script described above is not available, you are required to type SMTP commands for verification (see RFC 2821, espe- cially 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. From version 0.1.4.2005010914 on, this script supports 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. 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 code 2 for all addresses. (TODO) -d, --force-dupes Force MXs with different host name but same IP address to be asked for EMAIL_ADDRESS. (TODO) -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, --help Display this help screen and exit with code 255. -l, --listen Listen for parameters from stdin or on the PORT specified with -p. Corresponds remotely with the locally given -s option. For security reasons, 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. (TODO) -s, --server SERVER Specify a chkmadd SERVER to be used instead of the local pro- gram, 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. The server either must be configured to run the remote chk- madd(1) program with the -l option alone upon receipt of a request on PORT (using inetd(8), tcpd(8) and the like) or have it already running and --listening on the port specified with -p (preferably as a system daemon). (TODO) -t, --timeout SECONDS Specify the timeout for the expect(1) SCRIPT. -V, --version Display version information and exit with code 255. -v, --verbose Be verbose. -y, --no-vrfy Skip VRFY command. (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 255 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. RFC 2821 -- Simple Mail Transfer Protocol (SMTP), J. Klensin, April 2001. expect(1) , chkmadd.exp(1) BUGS None known. Please report bugs to . 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] [2] [3] [4] [5] LEGAL NOTICE Copyright (c) 2003-2005 Thomas Lahn 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 MER- CHANTABILITY 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 Founda- tion, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. [1] -- 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 for test cases and to Don Libes for the great expect(1) tool. AVAILABILITY The author's latest version can be obtained from . chkmadd 0.1.5.2006033102 21 APRIL 2006 chkmadd(1)