Postfix is installed but how do I test it?

Matt Elhotiby picture Matt Elhotiby · Jan 25, 2011 · Viewed 117.8k times · Source

I tried everything, I read online to test, and I can't get email to go out:

telnet <IP> 25
EHLO
MAIL FROM: <from-email>
RCPT TO: <recipient-email>
DATA
Type message here.
. <Enter>
=>

I even tried this, and when I type the period, I get nothing - but postfix is installed.

Answer

Raghav Rach picture Raghav Rach · May 6, 2013

To check whether postfix is running or not

sudo postfix status

If it is not running, start it.

sudo postfix start

Then telnet to localhost port 25 to test the email id

ehlo localhost
mail from: root@localhost
rcpt to: your_email_id
data
Subject: My first mail on Postfix

Hi,
Are you there?
regards,
Admin
.

Do not forget the . at the end, which indicates end of line