Telnet into the postfix machine on port 25 and send a mail in this fashion. If you are in the
$mynetworks in /etc/postfix/main.cf, you will not need to authenticate. If you are not, it
might be best to use a mail client and send a username and password. Otherwise, SMTP will reject you.
[root\@mail postfix]\# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.foobar.com NO UCE
helo localhost.localdomain
250 mail.foobar.com
mail from: foobar@foobar.com
250 Ok
rcpt to: sballmer@microsoft.com
250 Ok
data <enter>
354 End data with <CR><LF>.<CR><LF>
Your mother is a hamster, and your father smells of elderberries. <enter>
. <enter>
250 Ok: queued as DE505FCE0
quit
221 Bye
Connection closed by foreign host.
If you see the output ''250 Ok: queued as 'some number' '', the mail was sent.
//
Another good test is sending a mail from the command line on the mail machine while running
tail -f /var/log/maillog
on another terminal (tty1, tty2, etc)
echo hello | mail foobar@foobar.com
The tail command should show something like this:
Aug 12 16:27:17 mail postfix/pickup[20749]: 50F24FDD6: uid=0 from=<root>
Aug 12 16:27:17 mail postfix/cleanup[20930]: 50F24FDD6:
message-id=<20050812202717.50F24FDD6@mail.foobar.com>
Aug 12 16:27:17 mail postfix/qmgr[19739]: 50F24FDD6:
from=<root@mail.foobar.com>, size=275, nrcpt=3 (queue active)
Aug 12 16:27:17 mail lmtpunix[20768]: duplicate_check:
<20050812202717.50F24FDD6@mail.foobar.com> foobar.com!user.foobar 0
Aug 12 16:27:17 mail lmtpunix[20768]: mystore: starting txn 2147483855
Aug 12 16:27:17 mail lmtpunix[20768]: mystore: committing txn 2147483855
Aug 12 16:27:17 mail lmtpunix[20768]: duplicate_mark:
<20050812202717.50F24FDD6@mail.foobar.com> foobar.com!user.foobar 1123878437 17
Aug 12 16:27:17 mail lmtpunix[20768]: mystore: starting txn 2147483856
Aug 12 16:27:17 mail lmtpunix[20768]: mystore: committing txn 2147483856
Aug 12 16:27:17 mail lmtpunix[20768]: duplicate_mark:
<20050812202717.50F24FDD6@mail.foobar.com> .foobar+@foobar.com.sieve. 1123878437 0
Aug 12 16:27:17 mail postfix/lmtp[20933]: 50F24FDD6: to=<foobar@foobar.com>,
relay=/var/lib/imap/socket/lmtp[/var/lib/imap/socket/lmtp], delay=0,
status=sent (250 2.1.5 Ok)
Aug 12 16:27:18 mail postfix/qmgr[19739]: 50F24FDD6: removed
Amin Astaneh
2007-02-28