Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to setup automatic security updates on Ubuntu Server 12.04 LTS with an email response:

sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
# Answered Yes

The upgrades work, but I get the following email:

Subject: unattended-upgrades result for 'ubuntu' with an empty body and the attachment of unattended-upgrades result for 'ubuntu'.dat

Opening the .dat file in a text editor shows everything, but I'd like to just have this as the body

Here is contents of /etc/apt/apt.conf.d/50unattended-upgrades

// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
//      "${distro_id}:${distro_codename}-updates";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";

// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides
// 'mailx' must be installed.
Unattended-Upgrade::Mail "";

Everything else is commented out

share|improve this question
I can't find anything in the unattended-upgrades source code that would generate MIME or MIME attachments. What mail client are you using? – sarnold Jun 26 '13 at 23:24
Happened with both Outlook 2010 and Gmail web client. Here is the raw message: – chrisan Jun 27 '13 at 0:09
up vote 2 down vote accepted

Aha, thanks for the raw message, that makes all the difference.

The heirloom-mailx mailer is trying to be helpful; it isn't the unattended-upgrades script itself that is creating the attachments. If you want to keep heirloom-mailx, you can try creating a new configuration file to set the encoding variable to different values, and use the MAILRC environment variable to select the different configuration. Probably some configuration can be found that will just send along the data without any mangling.

Another option would be to use the bsd-mailx version of mailx(1) instead, it is less helpful and will just send raw data.

share|improve this answer
ahh thank you! I went for the bsd-mailx route and it worked perfectly. Thanks again (I'd upvote by apparently my stackoverflow rep doesnt carry over and I don't have enough rep here to upvote yet) – chrisan Jun 27 '13 at 0:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.