> Source: [sk127192](https://support.checkpoint.com/results/sk/sk127192)

# sk127192 - How to step through mail issues with sendmail and telnet 

| Property | Value |
|----------|-------|
| Solution ID | sk127192 |
| Date Created | 2018-05-17 |
| Last Modified | 2018-05-17 |
| Technical Level | General |
| Products | Security Gateway, Security Management Server |
| Versions | R82.10, R82, R81.20, R82.10, R82, R81.20, R82.20 |
| OS | Gaia |

## Solution

#### **Abstract**

In a scenario when emails are not making it to a particular destination, it is required to use another method to test SMTP connectivity that could result from a non-exisest recipient to other possible issues in the process.  

**Follow these steps:**   

1. Utilizing sendmail on the Security Gateway or Management server.  
   1. Create a simple text file for test email

   **`[Expert@HOSTNAME:0]# touch sendmail_test <enter>`**   

   2. Edit the file.

   **`[Expert@HOSTNAME:0]# vi sendmail_test <enter>`**   

   3. Add the following syntax to the "sendmail_test" file through **vi** command.

   **\*Format to be replaced by your relevant input\***   

   ```
   FROM ADDRESS (can be anything)
   TO ADDRESS
   SUBJECT
   BODY
   ```

   4. **\*For Example\***

   ```
   hugo-1@hugo.com
   main@geyser.com
   This is the Subject
   This is the Body
   ```

   <br />

   5. Run the command with the 'sendmail_test' file in the present directory.

   **`[Expert@HOSTNAME:0]# $FWDIR/bin/sendmail -t MAIL_SERVER_IP -m sendmail_test <enter>`**   

   6. Check the mail server for mail.

   ![](https://sc1.checkpoint.com/sc/SolutionsStatics/NEW_SK_NOID1526501696646/sendmail1805161325.PNG)

2. Another method to troubleshoot SMTP connectivity is telnet to a mail server from the Gateway.  

   1. Connect over telnet

   **`# telnet MAIL_SERVER_IP 25 <enter>`**   

   Possible Response:  

   *220 localhost ESMTP*   

   2. Greet the server by typing (it might be EHLO or HELO)

   **`HELO yourdomain.com <enter>`**   

   Possible Response:  

   *250 Hello.*   

   3. Tell the server who the mail is from

   **`MAIL FROM: me@mydomain.com`**   

   Possible Response:  

   *250 OK*   

   4. Enter the recipient's address.

   **`RCPT TO: you@yourdomain.com <enter>`**   

   Possible Response:  

   *250 OK*   

   5. Enter data

   **`DATA <enter>`**   

   Possible Response:  

   *354 OK, send.*   

   Type your message here in the new line  

   *Subject: Test sendmail email*   

   *\<enter\>*   

   *\<enter\>*   

   *Type message here*   

   *(End the message with a period)*   

   *. \<enter\>*   

   *Possible Response:*   
   *250 Queued (9.408 seconds)*   

   6. Exit the connection

   **`QUIT <enter>`**   

   Possible Response:  

   *221 goodbye*   

   *Connection closed by foreign host.*   

   7. Snippet for reference.

   ![](https://sc1.checkpoint.com/sc/SolutionsStatics/NEW_SK_NOID1526501696646/telnetsmtp1805161347.PNG)  

<br />

<br />

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
