# Cis Ubuntu1604 V200 2 1 15

> Ensure mail transfer agent is configured for local-only mode

- Skill: `cyberstrikeus/cis-ubuntu1604-v200-2-1-15` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add cyberstrikeus/cis-ubuntu1604-v200-2-1-15`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cyberstrikeus/cis-ubuntu1604-v200-2-1-15/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: cyberstrikeus (https://skillmd.com/u/cyberstrikeus)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/cyberstrikeus/cis-ubuntu1604-v200-2-1-15

---


# 2.1.15 Ensure mail transfer agent is configured for local-only mode (Automated)

## Description

Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail.

Note: This recommendation is designed around the exim4 mail server, depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state.

## Rationale

The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems.

## Audit Procedure

### Command Line

Run the following command to verify that the MTA is not listening on any non-loopback address (127.0.0.1 or ::1). Nothing should be returned:

```bash
ss -lntu | grep -E ':25\s' | grep -E -v '\s(127.0.0.1|::1):25\s'
```

## Expected Result

Nothing should be returned. If output is produced, the MTA is listening on a non-loopback address.

## Remediation

### Command Line

Edit `/etc/exim4/update-exim4.conf.conf` and add and or modify following lines to look like the lines below:

```
dc_eximconfig_configtype='local'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
```

Restart exim4:

```bash
systemctl restart exim4
```

## Default Value

The MTA is configured for local-only mode on default installations.

## References

1. CIS Controls v7 - 9.2 Ensure Only Approved Ports, Protocols and Services Are Running

## Profile

- Level 1 - Server
- Level 1 - Workstation

