{"id":3319,"date":"2012-06-04T21:45:47","date_gmt":"2012-06-04T13:45:47","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3319"},"modified":"2023-04-28T09:49:15","modified_gmt":"2023-04-28T09:49:15","slug":"how-to-test-posfix-mail-service-using-telnet","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-test-posfix-mail-service-using-telnet\/","title":{"rendered":"How to Test Posfix Mail Service using Telnet"},"content":{"rendered":"<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--1024x594.png\" alt=\"postfix telnet\" width=\"1024\" height=\"594\" class=\"img-fluid alignnone size-large wp-image-13561 lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--1024x594.png 1024w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--300x174.png 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--1536x891.png 1536w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--128x74.png 128w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--420x244.png 420w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--540x313.png 540w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--720x418.png 720w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--960x557.png 960w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--1140x661.png 1140w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--1320x766.png 1320w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet--1241x720.png 1241w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2012\/06\/postfix-telnet-.png 1748w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/594;\" \/><\/p>\n<p>In order to test the mail services working properly, testing needs to be performed. Instead of using GUI mail client or webmail to test the sending and receiving email,you also can use telnet. Telnet is the most basic mail client. It does the same thing as advanced mail client such as Microsoft Outlook and Mozilla Thunderbird. Telnet will verify and check the server responses to mail requests that was typed.<\/p>\n<h3>Perform Testing for Posfix Mail Service using Telnet on linux shell :<\/h3>\n<pre>[root@mail ~]# telnet localhost 25\r\nTrying 127.0.0.1...\r\nConnected to localhost.\r\nEscape character is '^]'.\r\n220 mail.zimbra.local ESMTP Postfix\r\nHelo mail.zimbra.local\r\n250 mail.zimbra.local\r\nMAIL FROM:&lt;admin@zimbra.local&gt;\r\n250 2.1.0 Ok\r\nRCPT TO:&lt;user@zimbra.local&gt;\r\n250 2.1.5 Ok\r\nDATA\r\n354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;\r\nSubject: My Test Email\r\nThis is the body of the Email\r\n.\r\n250 2.0.0 Ok: queued as 194869C1AB\r\nquit\r\n221 2.0.0 Bye\r\nConnection closed by foreign host.\r\n<\/pre>\n<h3>Perform Testing for Posfix Mail Service using Telnet on Windows Command Prompt :<\/h3>\n<pre>C:\\&gt;telnet mail.zimbra.local 25\r\n\r\n220 mail.zimbra.local ESMTP Postfix\r\nehlo mail.zimbra.local\r\n250-mail.zimbra.local\r\n250-PIPELINING\r\n250-SIZE 10240000\r\n250-VRFY\r\n250-ETRN\r\n250-STARTTLS\r\n250-ENHANCEDSTATUSCODES\r\n250-8BITMIME\r\n250 DSN\r\nMAIL FROM:&lt;admin@zimbra.local&gt;\r\n250 2.1.0 Ok\r\nRCPT TO:&lt;user@zimbra.local&gt;\r\n250 2.1.5 Ok\r\nDATA\r\n354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;\r\nSubject: My Test Email\r\nThis is the body of the EMAIL Message!\r\n.\r\n250 2.0.0 Ok: queued as 538BB9C1AD\r\n<\/pre>\n<h3>Steps to Perform Testing the Postfix Mail Service<\/h3>\n<p>1. Establish a TCP connection to port 25 which is postfix port :<\/p>\n<pre>[root@mail ~]# telnet localhost 25\r\n<\/pre>\n<p>You should receive a 220 response:<\/p>\n<pre>Trying 127.0.0.1...\r\nConnected to localhost.\r\nEscape character is '^]'.\r\n220 mail.zimbra.local ESMTP Postfix\r\n<\/pre>\n<p>Postfix is listening and we can communicate with SMTP now.<\/p>\n<p>2. Next,greet the postfix server. The function is considered same with postman or transport :<\/p>\n<pre>Helo mail.zimbra.local\r\n<\/pre>\n<p>The postfix mail server should respond as below :<\/p>\n<pre>250 mail.zimbra.local\r\n<\/pre>\n<p>3. Inform the postfix server know who the sender is:<\/p>\n<pre>MAIL FROM:&lt;admin@zimbra.local&gt;\r\n<\/pre>\n<p>You will get &#8216;250&#8217; output if the postfix accepts the sender address :<\/p>\n<pre>250 2.1.0 Ok\r\n<\/pre>\n<p>4. Specify the recipient of the email :<\/p>\n<pre>RCPT TO:&lt;user@zimbra.local&gt;\r\n<\/pre>\n<p>If Postfix accepts the recipient address will returned 250 response :<\/p>\n<pre>250 2.1.5 Ok\r\n<\/pre>\n<p>5. Send the actual Email with subject and body of the email :<\/p>\n<pre>DATA\r\n<\/pre>\n<p>Postfix agrees and feedback us to start actual email and returned this output :<\/p>\n<pre>354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;\r\n<\/pre>\n<p>6. Start compose the mail, type the word &#8216;Subject:&#8217; for email subject then enter. Type email body end our input with a dot.<\/p>\n<pre>Subject: My Test Email\r\nThis is the body of the Email\r\n.\r\n<\/pre>\n<p>As before, if postfix agress and accepts the email, it will returned 250 response :<\/p>\n<pre>250 2.0.0 Ok: queued as 194869C1AB\r\n<\/pre>\n<p>7. Postfix test fixt telnet finished at the moment, So you can quit :<\/p>\n<pre>quit\r\n<\/pre>\n<pre>221 2.0.0 Bye\r\nConnection closed by foreign host.\r\n<\/pre>\n<h3>Trace the mail on Postfix Mail server using message ID :<\/h3>\n<p>On Linux shell, message id is 194869C1AB :<\/p>\n<pre>[root@mail ~]# cat \/var\/log\/maillog | grep 194869C1AB\r\nJun  5 01:58:21 mail postfix\/smtpd[12285]: 194869C1AB: client=localhost.localdomain[127.0.0.1]\r\nJun  5 01:59:24 mail postfix\/cleanup[17117]: 194869C1AB: message-id=&lt;20120604175821.194869C1AB@mail.zimbra.local&gt;\r\nJun  5 01:59:24 mail postfix\/qmgr[4464]: 194869C1AB: from=&lt;admin@zimbra.local&gt;, size=409, nrcpt=1 (queue active)\r\nJun  5 01:59:25 mail postfix\/cleanup[17117]: 52A7E9C1AD: message-id=&lt;20120604175821.194869C1AB@mail.zimbra.local&gt;\r\nJun  5 01:59:25 mail postfix\/smtp[17317]: 194869C1AB: to=&lt;user@zimbra.local&gt;, relay=127.0.0.1[127.0.0.1]:10024, delay=73, delays=72\/0.02\/0.1\/0.76, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 52A7E9C1AD)\r\nJun  5 01:59:25 mail postfix\/qmgr[4464]: 194869C1AB: removed\r\n<\/pre>\n<p>On Windows Command Prompt, the message id is 538BB9C1AD.<\/p>\n<pre>[root@mail ~]# cat \/var\/log\/maillog | grep 538BB9C1AD\r\nJun  5 02:14:08 mail postfix\/smtpd[21232]: 538BB9C1AD: client=unknown[192.168.1.52]\r\nJun  5 02:14:55 mail postfix\/cleanup[22300]: 538BB9C1AD: message-id=&lt;20120604181408.538BB9C1AD@mail.zimbra.local&gt;\r\nJun  5 02:14:55 mail postfix\/qmgr[4464]: 538BB9C1AD: from=&lt;admin@zimbra.local&gt;, size=408, nrcpt=1 (queue active)\r\nJun  5 02:15:05 mail postfix\/cleanup[22300]: EDD0E9C1AE: message-id=&lt;20120604181408.538BB9C1AD@mail.zimbra.local&gt;\r\nJun  5 02:15:05 mail postfix\/smtp[22317]: 538BB9C1AD: to=&lt;user@zimbra.local&gt;, relay=127.0.0.1[127.0.0.1]:10024, delay=74, delays=65\/0.02\/1.6\/7.8, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as EDD0E9C1AE)\r\nJun  5 02:15:05 mail postfix\/qmgr[4464]: 538BB9C1AD: removed\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In order to test the mail services working properly, testing needs to be performed. Instead of using GUI mail client or webmail to test the sending and receiving email,you also&#8230;<\/p>\n","protected":false},"author":6,"featured_media":13561,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2065,1028,1100],"tags":[1536,1664,1832,1849,1951,1953],"class_list":["post-3319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mail","category-postfix","category-zimbra","tag-linux","tag-postfix","tag-test-postfix","tag-troubleshooting","tag-zimbra-collaboration-suite","tag-zimbra-mail-server"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=3319"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3319\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/13561"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=3319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}