Sunday 29 May 2011

Testing sending mail with Postfix

Yesterday, I was looking for a simple way of testing my installation of postfix and after a bit of digging I found the following:

telnet 10.168.20.229 25
Trying 10.168.20.229...
Connected to 10.168.20.229.
Escape character is '^]'.
220 RHEL6KSTest1.dev.com ESMTP Postfix
EHLO hostname
250-rh.dev.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: crazy@dev.com
250 2.1.0 Ok
RCPT TO: loco@dev.com
250 2.1.5 Ok
DATA
354 End data with .
This is a test email
.
250 2.0.0 Ok: queued as B8EF51A4D
quit

You might need to install telnet (yum install telnet)

You can then check with mail:

[root@RHEL6KSTest1 ~]# mail -u loco
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/root": 1 message
> 1 crazy@dev.com Sun May 29 12:16 15/511
&

No comments:

Post a Comment