During the processing of configuring a mail server you may want to send email as close to the cold iron as possible. Using telnet to directly interact with the Simple Mail Transfer Protocol (SMTP) utility is a good technique to have handy.
These UNIX commands have been taken directly from a Terminal window - these are the commands I use - rather than having been composed after the fact. This is *exactly* what worked for me. I've taken pains to choose forms of the commands which should make sense to you even if you're new to UNIX.
Connecting to the SMTP process
At the UNIX prompt start telnet with the name of the target machine (localhost, if the local computer) and the target port (smtp will specify the actual port in use, or 25 if you feel you must enter a numeric value).
Examples of what you type appears in boldface (you'll need some valid username and recipient values for your system configuration).
% telnet localhost smtp
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 server.geektimes.com ESMTP Sendmail ...
helo username
250 server.geektimes.com Hello localhost [127.0.0.1], pleased to meet you
mail from:sender@example.com
250 2.1.0 sender@example.com... Sender ok
rcpt to:recipient@GeekTimes.com
250 2.1.5 recipient@GeekTimes.com... Recipient ok (will queue)
data
354 Enter mail, end with "." on a line by itself
This is a test message from sender@example.com to recipient@GeekTimes.com.
The next line contains a period followed by the Return key.
.
250 2.0.0 g8S87cpB000444 Message accepted for delivery
quit
221 2.0.0 server.geektimes.com closing connection
Connection closed by foreign host.
%
|
You might want to - okay, you really ought to - jump up one level, to see how this fits into the big picture of deploying a mail server.