{"id":78641,"date":"2025-12-02T15:52:18","date_gmt":"2025-12-02T15:52:18","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=78641"},"modified":"2025-12-02T15:52:19","modified_gmt":"2025-12-02T15:52:19","slug":"smtp-purpose-installation-steps-data-format","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=78641","title":{"rendered":"SMTP: Purpose, Installation, Steps, Data Format"},"content":{"rendered":"\n<p>Below is a <strong>30\u201340 minute SMTP lesson plan<\/strong> suitable for college-level networking courses . It includes: purpose, tools, installations, commands, protocol operations, Telnet interaction, data formats, and references to typical Wireshark visuals (without reproducing copyrighted images).<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udcd8 SMTP Lesson Plan (30\u201340 Minutes)<\/strong><\/h1>\n\n\n\n<p><strong>Topic:<\/strong> Simple Mail Transfer Protocol (SMTP)<br><strong>Audience:<\/strong> Networking \/ IT Students<br><strong>Goal:<\/strong> Understand SMTP purpose, workflow, commands, install &amp; test SMTP on Ubuntu, and observe the protocol using Telnet &amp; Wireshark.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>1. Introduction (3\u20135 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is SMTP?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SMTP = <strong>Simple Mail Transfer Protocol<\/strong><\/li>\n\n\n\n<li>Purpose: <strong>Transfers email from client \u2192 server \u2192 another server<\/strong><\/li>\n\n\n\n<li>Operates at <strong>Application Layer (Layer 7)<\/strong><\/li>\n\n\n\n<li>Uses TCP port:\n<ul class=\"wp-block-list\">\n<li><strong>25<\/strong> (server-to-server)<\/li>\n\n\n\n<li><strong>587<\/strong> (submission with TLS)<\/li>\n\n\n\n<li><strong>465<\/strong> (legacy SSL)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>When SMTP is used<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Sending email from a mail client (like Thunderbird, Outlook).<\/li>\n\n\n\n<li>Relaying mail between mail servers.<\/li>\n\n\n\n<li>Transporting server-generated notifications (cron, monitoring).<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>2. Tools Required (1\u20132 minutes)<\/strong><\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Tool<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><strong>Ubuntu Server<\/strong><\/td><td>Install and run SMTP daemon (Postfix).<\/td><\/tr><tr><td><strong>Telnet or Netcat<\/strong><\/td><td>Manual SMTP interaction.<\/td><\/tr><tr><td><strong>Wireshark<\/strong><\/td><td>Capture &amp; analyze SMTP packets.<\/td><\/tr><tr><td><strong>DNS Tools (dig\/nslookup)<\/strong><\/td><td>Check MX records for mail routing.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>3. Ubuntu Setup (5 minutes)<\/strong><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Install Postfix SMTP Server<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install postfix\n<\/code><\/pre>\n\n\n\n<p>When prompted:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Select <strong>Internet Site<\/strong><\/li>\n\n\n\n<li>System mail name: <code>yourdomain.test<\/code> (or localhost)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Check Postfix Status<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status postfix\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Check SMTP is listening<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ss -tlnp | grep 25\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Log file for debugging<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tail -f \/var\/log\/mail.log\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>4. SMTP Protocol Basics (5 minutes)<\/strong><\/h1>\n\n\n\n<p>SMTP uses simple <strong>ASCII-based commands<\/strong>.<br>You can refer to standard diagrams online (e.g., RFC 5321 command flow), which show:<\/p>\n\n\n\n<p><strong>Client \u2192 Server commands<\/strong><br><strong>Server \u2192 Client status codes<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Common SMTP Commands<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><strong>HELO \/ EHLO<\/strong><\/td><td>Identify client (EHLO supports extensions).<\/td><\/tr><tr><td><strong>MAIL FROM:<\/strong><\/td><td>Sender envelope address.<\/td><\/tr><tr><td><strong>RCPT TO:<\/strong><\/td><td>Recipient address.<\/td><\/tr><tr><td><strong>DATA<\/strong><\/td><td>Begins message content.<\/td><\/tr><tr><td><strong>QUIT<\/strong><\/td><td>Close connection.<\/td><\/tr><tr><td><strong>RSET<\/strong><\/td><td>Reset session.<\/td><\/tr><tr><td><strong>VRFY<\/strong><\/td><td>Verify user existence (often disabled).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Common SMTP Status Codes<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><strong>220<\/strong><\/td><td>Server ready<\/td><\/tr><tr><td><strong>250<\/strong><\/td><td>OK<\/td><\/tr><tr><td><strong>354<\/strong><\/td><td>Start message input<\/td><\/tr><tr><td><strong>421<\/strong><\/td><td>Service unavailable<\/td><\/tr><tr><td><strong>550<\/strong><\/td><td>Mailbox unavailable<\/td><\/tr><tr><td><strong>551<\/strong><\/td><td>User not local<\/td><\/tr><tr><td><strong>552\u2013554<\/strong><\/td><td>Message rejected<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Reference:<\/strong><br>Online SMTP diagrams typically show a vertical message exchange: client commands on left, server replies on right, with arrows showing flow.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>5. SMTP Workflow (4 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step-by-Step Exchange<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Client connects<\/strong> to port 25<br>\u2192 Server replies <code>220<\/code><\/li>\n\n\n\n<li><strong>HELO\/EHLO<\/strong><br>\u2192 Server lists capabilities<\/li>\n\n\n\n<li><strong>MAIL FROM:<\/strong><br>\u2192 Server responds <code>250 OK<\/code><\/li>\n\n\n\n<li><strong>RCPT TO:<\/strong><br>\u2192 Server responds <code>250 OK<\/code><\/li>\n\n\n\n<li><strong>DATA<\/strong><br>\u2192 Server responds <code>354 End with &lt;CRLF>.&lt;CRLF><\/code><\/li>\n\n\n\n<li><strong>Message body sent<\/strong><br>\u2192 End message with a single dot <code>.<\/code><\/li>\n\n\n\n<li><strong>QUIT<\/strong><\/li>\n<\/ol>\n\n\n\n<p>This is the <strong>\u201cEnvelope + Content\u201d<\/strong> model.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>6. Hands-On SMTP via Telnet (8 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Connect to the local SMTP server<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>telnet localhost 25\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Sample Full Exchange<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Connected to localhost.\n220 mail.yourdomain.test ESMTP Postfix\n\nEHLO client.test\n250-mail.yourdomain.test\n250-PIPELINING\n250-SIZE 10240000\n250-STARTTLS\n250-ENHANCEDSTATUSCODES\n250 8BITMIME\n\nMAIL FROM:&lt;alice@client.test&gt;\n250 2.1.0 Ok\n\nRCPT TO:&lt;bob@server.test&gt;\n250 2.1.5 Ok\n\nDATA\n354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;\nSubject: Test Email\nFrom: alice@client.test\nTo: bob@server.test\n\nHello Bob,  \nThis is a test sent via raw SMTP.  \n\n.\n250 2.0.0 Ok: queued as XYZ123\n\nQUIT\n221 2.0.0 Bye\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What Students Should Notice<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interaction is <strong>plain-text<\/strong>, line-based.<\/li>\n\n\n\n<li>Email has:\n<ul class=\"wp-block-list\">\n<li><strong>Headers<\/strong> (Subject, From, To)<\/li>\n\n\n\n<li><strong>Blank line<\/strong><\/li>\n\n\n\n<li><strong>Body<\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Ending with <code>.<\/code> terminates DATA mode.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>7. Listing Mails in the Queue (Postfix) (2 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Show queue<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mailq\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Remove queue<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo postsuper -d ALL\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>8. SMTP Message Format (3 minutes)<\/strong><\/h1>\n\n\n\n<p>Students can search for diagrams of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SMTP envelope vs. email headers<\/strong><\/li>\n\n\n\n<li><strong>RFC 5322 message structure<\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Typical Email Format<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>MAIL FROM: &lt;sender@example.com&gt;    \u2190 Envelope\nRCPT TO: &lt;receiver@example.com&gt;    \u2190 Envelope\n\n--- Data Section ---\n\nSubject: Meeting Tomorrow\nFrom: Sender &lt;sender@example.com&gt;\nTo: Receiver &lt;receiver@example.com&gt;\nDate: Tue, 02 Dec 2025 13:15:00 -0500\n\nHello,\nThis is the body of the message.\n<\/code><\/pre>\n\n\n\n<p>Key concepts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Envelope addresses \u2260 Header addresses<\/li>\n\n\n\n<li>Headers follow strict ASCII formatting<\/li>\n\n\n\n<li>Blank line separates headers from body<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>9. Analyzing SMTP Traffic in Wireshark (5 minutes)<\/strong><\/h1>\n\n\n\n<p>Tell students to search:<br><strong>\u201cWireshark SMTP packet details\u201d images<\/strong><br>These images typically show:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What Wireshark Displays<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>TCP handshake (SYN, SYN-ACK, ACK)<\/li>\n\n\n\n<li>SMTP commands as text under <code>Application Layer<\/code><\/li>\n\n\n\n<li>Status codes (220, 250, 354)<\/li>\n\n\n\n<li>DATA block containing header fields and message body<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Filters<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>tcp.port == 25\nsmtp\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Things to point out<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Application Layer tree expands to show each command.<\/li>\n\n\n\n<li>DATA section shows full email contents.<\/li>\n\n\n\n<li>No encryption on port 25 \u2192 Wireshark can see everything.<\/li>\n<\/ul>\n\n\n\n<p>Students will notice:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>How HELO\/EHLO appears as plain text.<\/li>\n\n\n\n<li>How the message body is captured.<\/li>\n\n\n\n<li>How multiple packets represent a single message transfer.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>10. Wrap-Up (2 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Key Takeaways<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SMTP is the primary protocol for sending emails.<\/li>\n\n\n\n<li>Simple plaintext command\/response system.<\/li>\n\n\n\n<li>Postfix provides a working SMTP server for labs.<\/li>\n\n\n\n<li>Telnet allows manual testing.<\/li>\n\n\n\n<li>Wireshark reveals how SMTP messages appear on the wire.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Optional Homework \/ Lab<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Capture an SMTP session with Wireshark.<\/li>\n\n\n\n<li>Send mail using <code>sendmail<\/code> or <code>mail<\/code> command.<\/li>\n\n\n\n<li>Configure SMTP over TLS (STARTTLS).<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<p>Below is <strong>(1)<\/strong> a clean, professional <strong>ASCII diagram of the full SMTP flow<\/strong>, and <strong>(2)<\/strong> a fully structured <strong>SMTP Lab Assignment<\/strong> with step-by-step tasks for students.<br>Everything is original, copyright-free<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udcd8 1. Full SMTP Flow Diagram (ASCII)<\/strong><\/h1>\n\n\n\n<p>This diagram shows the complete sequence between <strong>Mail User Agent (MUA)<\/strong>, <strong>Mail Submission Agent (MSA)<\/strong>, <strong>Mail Transfer Agent (MTA)<\/strong>, and <strong>Mail Delivery Agent (MDA)<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                   +------------------+\n                   |   User Client    |\n                   |  (MUA: Thunderbird,\n                   |   Outlook, etc.)|\n                   +--------+---------+\n                            |\n                            | SMTP Submission (Port 587)\n                            v\n                   +------------------+\n                   | MSA (Postfix)    |\n                   | Mail Submission  |\n                   +--------+---------+\n                            |\n                            | SMTP Relay (Port 25)\n                            v\n         ----------------------------------------------------------------\n         |                Internet (Multiple MTAs)                      |\n         |                                                              |\n         |   +------------------+        +------------------+           |\n         |   |   MTA #1         |  ---&gt;  |   MTA #2         |  ---&gt; ... |\n         |   | Mail Transfer    |        | Mail Transfer    |           |\n         |   +------------------+        +------------------+           |\n         ----------------------------------------------------------------\n                            |\n                            | SMTP Delivery (Port 25)\n                            v\n                   +------------------+\n                   |  MDA (Local Mail |\n                   |  Delivery Agent) |\n                   | e.g., Dovecot    |\n                   +--------+---------+\n                            |\n                            | Stores message\n                            v\n                   +------------------+\n                   | User Mailbox     |\n                   +------------------+\n                            |\n                            | IMAP\/POP Retrieval\n                            v\n                   +------------------+\n                   | Recipient MUA    |\n                   +------------------+\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>SMTP Command\/Response Flow Between Client &amp; Server<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Client \u2192    220 Server Ready\nClient \u2192    EHLO client.example\nServer \u2192    250-Server features\nClient \u2192    MAIL FROM:&lt;alice@example.com&gt;\nServer \u2192    250 OK\nClient \u2192    RCPT TO:&lt;bob@example.com&gt;\nServer \u2192    250 OK\nClient \u2192    DATA\nServer \u2192    354 End with &lt;CRLF&gt;.&lt;CRLF&gt;\nClient \u2192    (headers + message body)\nClient \u2192    .\nServer \u2192    250 Message Queued\nClient \u2192    QUIT\nServer \u2192    221 Goodbye\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udcd8 2. Full SMTP Lab Assignment (Step-By-Step)<\/strong><\/h1>\n\n\n\n<p><strong>Lab Duration:<\/strong> 45\u201360 minutes<br><strong>Environment:<\/strong> Ubuntu Server + GNS3 VM or physical system<br><strong>Learning Outcomes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install and configure SMTP (Postfix)<\/li>\n\n\n\n<li>Perform SMTP transactions using Telnet<\/li>\n\n\n\n<li>Analyze SMTP packets using Wireshark<\/li>\n\n\n\n<li>Understand envelope vs. header processing<\/li>\n\n\n\n<li>Observe mail queue behavior<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udd27 Part 1 \u2014 Setup (10 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Update System<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Install Postfix<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install postfix\n<\/code><\/pre>\n\n\n\n<p>During setup:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Select: <strong>Internet Site<\/strong><\/li>\n\n\n\n<li>System mail name: <code>labmail.test<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Confirm Postfix is Running<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status postfix\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Verify Port 25 Listening<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ss -tlnp | grep 25\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udce1 Part 2 \u2014 Manual SMTP Interaction (15\u201320 minutes)<\/strong><\/h1>\n\n\n\n<p>You will manually simulate an email client by using <strong>Telnet<\/strong> to speak SMTP commands to the server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Install telnet<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install telnet\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Connect to SMTP<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>telnet localhost 25\n<\/code><\/pre>\n\n\n\n<p>You should see:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>220 labmail.test ESMTP Postfix\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Identify Yourself<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>EHLO student.test\n<\/code><\/pre>\n\n\n\n<p>Expected:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>250-labmail.test\n250-PIPELINING\n250-SIZE 10240000\n250-STARTTLS\n250 8BITMIME\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Start Sending an Email<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>MAIL FROM:&lt;alice@student.test&gt;\n250 OK\n\nRCPT TO:&lt;bob@student.test&gt;\n250 OK\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Enter DATA Mode<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>DATA\n354 End data with &lt;CRLF&gt;.&lt;CRLF&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Type Message<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Subject: Lab SMTP Test\nFrom: Alice &lt;alice@student.test&gt;\nTo: Bob &lt;bob@student.test&gt;\n\nHello Bob,\nThis is a test email sent manually using SMTP.\n.\n<\/code><\/pre>\n\n\n\n<p>Server should reply:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>250 OK: queued as ABC123\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7. Quit<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>QUIT\n221 Bye\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udcec Part 3 \u2014 Inspect the Queue (5 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. View Mail Queue<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mailq\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. View logs<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tail -f \/var\/log\/mail.log\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Clear Queue (optional)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo postsuper -d ALL\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udd0d Part 4 \u2014 SMTP Packet Analysis with Wireshark (10\u201315 minutes)<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Start Wireshark<\/strong><\/h3>\n\n\n\n<p>Use interface: <strong>lo (loopback)<\/strong> or <strong>eth0<\/strong> depending on lab setup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Apply Filters<\/strong><\/h3>\n\n\n\n<p>SMTP filter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>smtp\n<\/code><\/pre>\n\n\n\n<p>Or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tcp.port == 25\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Repeat the Telnet SMTP Steps<\/strong><\/h3>\n\n\n\n<p>Wireshark will show:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>TCP handshake<\/strong><\/li>\n\n\n\n<li><strong>Plain-text SMTP commands<\/strong><\/li>\n\n\n\n<li><code>EHLO<\/code>, <code>MAIL<\/code>, <code>RCPT<\/code>, <code>DATA<\/code><\/li>\n\n\n\n<li>The <strong>entire message body<\/strong>, including headers and content<br>(good demonstration of SMTP being <em>unencrypted<\/em>).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Students Should Identify:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SMTP status codes<\/li>\n\n\n\n<li>Envelope commands<\/li>\n\n\n\n<li>Message headers (Subject, From, To)<\/li>\n\n\n\n<li>Body block ending with <code>.<\/code><\/li>\n\n\n\n<li>Server replies (250, 354, 221)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udcdd Part 5 \u2014 Written Questions (Instructor-Evaluated)<\/strong><\/h1>\n\n\n\n<p>Students answer the following:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. What is the purpose of EHLO vs HELO?<\/strong><\/h3>\n\n\n\n<p>(Expect: EHLO identifies client and requests extended SMTP features.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Why is DATA separated from the envelope?<\/strong><\/h3>\n\n\n\n<p>(Expect: Envelope controls routing; DATA contains RFC 5322 email.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Why does SMTP require <code>&lt;CRLF&gt;.&lt;CRLF&gt;<\/code> to end data?<\/strong><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Why can Wireshark read everything over port 25?<\/strong><\/h3>\n\n\n\n<p>(Expect: SMTP is plaintext without TLS.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Describe one security issue with allowing open relay.<\/strong><\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>\ud83d\udce6 Part 6 \u2014 Optional Extensions<\/strong><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Enable STARTTLS<\/strong><\/h3>\n\n\n\n<p>Show how encrypted SMTP prevents Wireshark from reading content.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Add DNS MX Record Lab<\/strong><\/h3>\n\n\n\n<p>Use <code>dig MX<\/code> to observe mail routing.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below is a 30\u201340 minute SMTP lesson plan suitable for college-level networking courses . It includes: purpose, tools, installations, commands, protocol operations, Telnet interaction, data formats, and references to typical Wireshark visuals (without reproducing copyrighted images). \ud83d\udcd8 SMTP Lesson Plan (30\u201340 Minutes) Topic: Simple Mail Transfer Protocol (SMTP)Audience: Networking \/ IT StudentsGoal: Understand SMTP purpose, &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=78641\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1978],"tags":[],"class_list":["post-78641","post","type-post","status-publish","format-standard","hentry","category-computer-networks","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":70055,"url":"http:\/\/bangla.sitestree.com\/?p=70055","url_meta":{"origin":78641,"position":0},"title":"Emailing in PHP: use PHP Mailer Package #16","author":"Author-Check- Article-or-Video","date":"August 24, 2021","format":false,"excerpt":"Download PHPMailer Package from: http:\/\/sourceforge.net\/project\/showfiles.php?group_id=26031 Unzip=install In the class \"class.smtp.php\", there is a send method that can be used to send emails PHPMailer provides different ways of mailing: default php mail function [capabilities limited], Using a SMTP server [with or without authentication], using Sendmail software PHP mailer can attach files,\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78382,"url":"http:\/\/bangla.sitestree.com\/?p=78382","url_meta":{"origin":78641,"position":1},"title":"Implement DHCP Server in GNS 3: Experiment with DHCP Protocol with DHCP server and Clients","author":"Sayed","date":"August 23, 2025","format":false,"excerpt":"Experiment with the DHCP Protocol with a DHCP server and Clients Tools Required: GNS 3 VMWare Workstation Pro or Oracle VirtualBox GNS VM Wireshark Steps in GNS 3: Create the LAN segment Configure a DHCP Server From PCs (clients) : request IP address from the DHCP server Check the DHCP\u2026","rel":"","context":"In &quot;Computer Networks&quot;","block_context":{"text":"Computer Networks","link":"http:\/\/bangla.sitestree.com\/?cat=1978"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/08\/image-5.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7749,"url":"http:\/\/bangla.sitestree.com\/?p=7749","url_meta":{"origin":78641,"position":2},"title":"PHP \u09a4\u09c7 \u0987\u09ae\u09c7\u0987\u09b2\u09bf\u0982 : PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09ac\u09cd\u09af\u09be\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c1\u09a8\u0983","author":"Author-Check- Article-or-Video","date":"March 28, 2015","format":false,"excerpt":"PHP \u09a4\u09c7 \u0987\u09ae\u09c7\u0987\u09b2\u09bf\u0982 : PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09ac\u09cd\u09af\u09be\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c1\u09a8\u0983 M A Razzak PHP \u09a4\u09c7 \u0987\u09ae\u09c7\u0987\u09b2\u09bf\u0982 : PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09ac\u09cd\u09af\u09be\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c1\u09a8\u0983 \u2022 \u09a8\u09bf\u099a\u09c7\u09b0 \u09b2\u09bf\u0999\u09cd\u0995 \u09a5\u09c7\u0995\u09c7 PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09a1\u09be\u0989\u09a8\u09b2\u09cb\u09a1 \u0995\u09b0\u09c1\u09a8\u0983 http:\/\/sourceforge.net\/project\/showfiles.php?group_id=26031 \u2022 \u0986\u09a8\u099c\u09bf\u09aa \u0995\u09b0\u09c7 \u0987\u09a8\u09b8\u09cd\u099f\u09b2 \u0995\u09b0\u09c1\u09a8\u0964 \u2022 \u0995\u09cd\u09b2\u09be\u09b8 \u098f \"class.smtp.php\" \u09af\u09be \u098f\u0995\u099f\u09bf \u09aa\u09cd\u09b0\u09c7\u09b0\u09a3 \u09aa\u09a6\u09cd\u09a7\u09a4\u09bf, \u0987\u09ae\u09c7\u0987\u09b2 \u09aa\u09be\u09a0\u09be\u09a8\u09cb\u09b0 \u099c\u09a8\u09cd\u09af \u098f\u099f\u09bf \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09be \u09af\u09c7\u09a4\u09c7 \u09aa\u09be\u09b0\u09c7\u0964 \u2022\u2026","rel":"","context":"In &quot;\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP&quot;","block_context":{"text":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP","link":"http:\/\/bangla.sitestree.com\/?cat=261"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":13378,"url":"http:\/\/bangla.sitestree.com\/?p=13378","url_meta":{"origin":78641,"position":3},"title":"Use custom email server for Magento based ecommerce shops","author":"Sayed","date":"October 18, 2017","format":false,"excerpt":"Use custom email server for Magento based ecommerce shops You will need to change code on the file : app\/code\/core\/Mage\/Core\/Model\/Email\/Template.php Comment out the existing getMail() method. And replace the method with the following code. Remember: changing the core Magento code is not the greatest idea as upgrade of Magento will\u2026","rel":"","context":"In &quot;Magento 2&quot;","block_context":{"text":"Magento 2","link":"http:\/\/bangla.sitestree.com\/?cat=1907"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10189,"url":"http:\/\/bangla.sitestree.com\/?p=10189","url_meta":{"origin":78641,"position":4},"title":"AddressVerifier.java Connects to an SMTP server and issues a expn request to display details about a mailbox on the server. Uses the following classes","author":"","date":"August 24, 2015","format":false,"excerpt":"import java.net.*; import java.io.*; \/** Given an e-mail address of the form user@host, \u00a0*\u00a0 connect to port 25 of the host and issue an \u00a0*\u00a0 'expn' request for the user. Print the results. \u00a0* \u00a0*\u00a0 Taken from Core Web Programming from \u00a0*\u00a0 Prentice Hall and Sun Microsystems Press, \u00a0*\u00a0 .\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24369,"url":"http:\/\/bangla.sitestree.com\/?p=24369","url_meta":{"origin":78641,"position":5},"title":"What are some advanced host settings for DNN? #Root","author":"Author-Check- Article-or-Video","date":"April 7, 2021","format":false,"excerpt":"What are some advanced host settings for DNN? Friendly URL Settings Proxy Settings SMTP Server Settings Performance Settings Jquery Settings CDN Settings dddd Client Resource Mgmt Membership Login IP Search Settings From: http:\/\/sitestree.com\/?p=3266 Categories:RootTags:DNN, dot net nuke Post Data:2016-01-23 22:46:07 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses:\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78641"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78641\/revisions"}],"predecessor-version":[{"id":78642,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78641\/revisions\/78642"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78641"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}