Skip to content

Instantly share code, notes, and snippets.

Last active Apr 5, 2019
What would you like to do?
Mailx and configuration for Cron email sending

To test use: echo "Something..." | mailx -v -A forcron -s "Cronjob completed on $(hostname)"

To install: apt install mailx

Edit this file: /etc/mail.rc or /etc/nail.rc

If you need, you can check which file by running strings /usr/bin/mailx | grep rc

set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via D$
account forcron {
set smtp-use-starttls
set ssl-verify=ignore
set smtp-auth=login
set smtp=smtp://
set from="Email Address <>"
set smtp-auth-user=USERNAME
set smtp-auth-password=PASSWORD
set nss-config-dir="/etc/pki/nssdb/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment