You are on page 1of 2

CentOS Mail Server

Test your Postfix SMTP Connection


First of all make sure that CentOS Linux Postfix Mail service is started service postfix status master (pid 4073) is running... Then we check if the port 25 (default smtp port) is ready and listening netstat -an | grep 25 tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN You might also want to ensure that Postfix service auto started at Level 3,4 and 5 chkconfig --list postfix postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off Else, you can start the postfix in the following service postfix start Starting postfix: [ OK ] The following command tells the system to auto startup the posfix system and level 3,4 and 5 [root@mail ~]# chkconfig postfix on Now, lets check the Postfix SMTP connection. The example below, we telnet to localhost (127.0.0.1) port 25 (smtp), then we using user account Jane to sent an email to James. telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.1a-centosserver.com ESMTP Postfix ehlo mail 250-mail.1a-centosserver.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:<jane> 250 2.1.0 Ok rcpt to:<james> 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> This is a test mail send from Jane .

250 2.0.0 Ok: queued as 8E93F27DF3 quit 221 2.0.0 Bye Connection closed by foreign host.

Where does our email go? All the new email send will be delivered to /home/user/Maildir/new. In our example below 1259937815.Vfd00Idf04dM230839.mail.1a-centosserver.com is the new email, you can read the mail content using "cat" command.

cd /home/james/Maildir/new -rw------- 1 james james 475 Dec 4 09:43 1259937815.Vfd00Idf04dM230839.mail.1a-centosserver.com [root@mail new]# cat 1259937815.Vfd00Idf04dM230839.mail.1a-centosserver.com Return-Path: <jane@1a-centosserver.com> X-Original-To: james Delivered-To: james@1a-centosserver.com Received: from mail (srv1.example.local [127.0.0.1]) by mail.1a-centosserver.com (Postfix) with ESMTP id 8E93F27DF3 for <james>; Fri, 4 Dec 2009 09:42:54 -0500 (EST) Message-Id: <20091204144313.8E93F27DF3@mail.1a-centosserver.com> Date: Fri, 4 Dec 2009 09:42:54 -0500 (EST) From: jane@1a-centosserver.com To: undisclosed-recipients:; This is a test mail send from Jane

You might also like