smtp-conversation-0.52 README Description =========== smtp-conversation is useful for testing SMTP server reachability. It can operate in two primary modes. In default mode (loop mode), it loops through the specified set of target servers, attempting to send test messages. By default it only sends a single test message, but this can be controlled by the --count option. In its alternate mode, will attempt to send test messages to all SMTP servers until it has succesfully sent a message through each target server. This mode can be switched on with the --until-success option. This utility accepts an arbitrary number of arguments. Sadly, there is no granularity of control over the timeouts. There is one timeout value for everything from the TCP SYN to '250 OK'. The tool is intended strictly for diagnostic purposes, and error reporting makes a best effort to determine whether the problem was a network layer problem or an SMTP layer problem. Obviously, this is only one very small part of mail troubleshooting. A zero-padded serial number is included in every subject line and body to assist diagnostic efforts. Message bodies will normally be very short, but can be increased by specifying a size in kilobytes (see options below). The exact number of bytes added in the padding routines may vary, but should approach the target number of kilobytes. Options ======= --recipient (-r): REQUIRED. Specify a single recipient address which will be used in the envelope and RFC 822 headers. --count (-c): Send this many email messages. Has no meaning in '--until-success' mode, and will be ignored. --bind (-b): Initiate connections from the specified IP. --interval (-i): Sleep this many seconds between the end of one connection and the beginning of the next. --until-success (-u): Keep looping until a message has been successfully sent. --kilobytes (-k): Pad the message with roughly this many kilobytes of random ASCII data. --timeout (-t): Only wait this long for the entire SMTP session (from SYN to "250 OK"). --message (-m): Include this tag on the subject line. --sender (-s): Use the specified address as the envelope sender and RFC 822 From line. Required software ================= - socat; a general purpose "cat" utility for files, file descriptors, sockets, FIFOs or pipes http://www.dest-unreach.org/socat/ smtp-conversation uses socat for all network operations, and relies on the error reporting generated from socat to communicate with the user - Basic UN*X utilities: perl, sed, uuencode, dd, cat, sleep, sed Recommended software ==================== - doalarm; sets an ALRM signal and exec's a child; ALRM signals are inherited from parent process http://directory.fsf.org/sysadmin/misc/doalarm.html http://pilcrow.madison.wi.us/sw/doalarm-0.1.7.tgz smtp-conversation will use perl to set an ALRM if doalarm is not installed, but the FSF package is much more lightweight Examples ======== Try to send a test message to test@domain.net through mail.domain.net with as little STDERR as possible. smtp-conversation -q -r test@domain.net mail.domain.net Try to send five messages of about 20k with an interval of two seconds. Use 127.0.0.1 as the SMTP server and be as chatty as possible. smtp-conversation -k 20 -i 2 -c 5 -vvr test@domain.net 127.0.0.1 Send one message from spoofed@gmail.com to test@domain.net through mx2.mail.yahoo.com. smtp-conversation -s spoofed@gmail.com -r test@domain.net mail4.mxsmtp.com Keep trying to send a test message to test@domain.net through flaky.server.net, until it accepts message for test@domain.net. smtp-conversation -u -r test@domain.net flaky.server.net Usage: smtp-conversation [ options ] -r [ ... ] Required option: -r, --recipient Intended recipient address. (required) Options (defaults marked, or in parentheses): -q, --quiet Reset verbosity to none. -v, --verbose Be verbose. (interactive default) -u, --until-success Loop until successful reaching server(s). -s, --sender Sender address to use. ($USER@$HOST_FQDN) -c, --count How many to send. (1) -k, --kilobytes How much padding to include. (0) -m, --message Text to prepend to subject line. ("SMTPTEST") -t, --timeout Timeout while waiting for 250 OK. (10) -i, --interval Interval in seconds between messages. (60) -b, --bind
Select address for outgoing connection. (INADDR_ANY)