Skip to content

The mailx Package Is Installed

An XCCDF Rule

Description

A mail server is required for sending emails. The mailx package can be installed with the following command:
$ sudo yum install mailx

Rationale

Emails can be used to notify designated personnel about important system events such as failures or warnings.

ID
xccdf_org.ssgproject.content_rule_package_mailx_installed
Severity
Medium
References
Updated

Remediation Templates

A Puppet Snippet

include install_mailx
class install_mailx {
  package { 'mailx':
    ensure => 'installed',
  }
}

OS Build Blueprint

[[packages]]
name = "mailx"
version = "*"

Anaconda Pre-Install Instructions

package --add=mailx

A Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
if ! rpm -q --quiet "mailx" ; then
    yum install -y "mailx"
fi

An Ansible Snippet

- name: Ensure mailx is installed
  package:
    name: mailx
    state: present
  when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
  tags: