Archive | July 30, 2014

Send email with the date in the subject using mutt

Send yourself a copy of the network interfaces file within the body of the email, using mutt and including the current date automatically:

1
mutt -s "$(date) Network Interfaces File" user@example.com < /etc/network/interfaces

To send the same email, and attach the file:

1
echo "" | mutt -s "$(date) Network Interfaces File" -a /etc/network/interfaces -- user@example.com

The resulting email looks like:

———- Forwarded message ———-
From: root
Date: Wed, Jul 30, 2014 at 2:40 AM
Subject: Wed Jul 30 02:40:26 EDT 2014 Network Interfaces File

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback