# Ensure Mail Transfer Agents Are Configured for Local-Only Mode

- Source: https://support.icompaas.com/support/solutions/articles/62000235216-ensure-mail-transfer-agents-are-configured-for-local-only-mode
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Amazon Linux 2 Benchmark v3.0.0](https://support.icompaas.com/support/solutions/62000112696) › [CIS Amazon Linux 2 Benchmarks](https://support.icompaas.com/support/solutions/folders/62000169265)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:** • Level 1

**Description:** Mail Transfer Agents (MTAs) like Postfix or Sendmail manage the sending and receiving of email. Configuring MTAs for local-only mode restricts mail transmission and reception to the local system, preventing the server from acting as an open relay and reducing exposure to external threats.

**Rationale:** Limiting MTAs to local-only mode prevents unauthorized relay of mail through the system, reducing spam abuse and mitigating potential email-based attacks.

**Impact:** Pros:

-   Prevents misuse of the server as an open mail relay.  
    
-   Limits attack surface related to mail services.  
    

Cons:

-   Restricts legitimate mail sending and receiving to local processes only.  
    

**Default Value:** MTAs may be configured to accept external mail by default; verification and adjustment are necessary.

**Pre-requisites:**

-   Root or sudo privileges to configure mail server settings.  
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

1\. Check MTA listening interfaces:  

netstat -plnt | grep postfix  
postfix status

2\. Verify MTA configuration files restrict listening to localhost or 127.0.0.1:  
  

grep '^inet\_interfaces' /etc/postfix/main.cf

3\. Confirm it is set to localhost or 127.0.0.1.  

### **Implementation Plan:**

**Using Linux command line:**

1\. Modify MTA configuration to listen on localhost only:

inet\_interfaces = localhost

2\. Restart the MTA service:  

systemctl restart postfix

3\. Verify the service listens only on localhost:  

netstat -plnt | grep postfix

### **Backout Plan:**

**Using Linux command line:**

1.  Revert inet\_interfaces to previous value if needed (e.g., all or specific IPs).
    
2.  Restart MTA service and verify functionality.  
    

References:

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   Postfix Configuration  
    
-   [NIST SP 800-53 Revision 5 - SC-7  
      
    ](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final#sc-7)
    

---

Tags:  
, , , , ,

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
