Skip to content

Instantly share code, notes, and snippets.

@emrahgunduz
Last active Apr 5, 2019
Embed
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)" email@example.com

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://example.com:587
set from="Email Address <email@example.com>"
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