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 - Anaconda Pre-Install Instructions


package --add=mailx

Remediation - OS Build Blueprint


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

Remediation - Ansible

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

Remediation - Puppet

include install_mailx

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

Remediation - 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