Dnf-automatic syntax vs. email notifications

Hi,

I’m currently moving my servers running CentOS 7 and Oracle Linux 7 to Rocky Linux 8. Up until now, I’ve been handling automatic updates using yum-cron with email notifications. This has been working perfectly for years.

Now I’m getting a grip on dnf-automatic, which works similarly to yum-cron. After installing the dnf-automatic package, I have an /etc/dnf/automatic.conf configuration file with annotations, and it’s more or less self-explanatory. On a side note, I noticed that contrary to CentOS, Rocky Linux does provide security meta-information about packages, so I get to choose between default updates or only those flagged as security updates, which is nice.

In the provided automatic.conf configuration file sample, there’s a redundancy that’s a bit puzzling. First, there’s a section [email] with the following default directives:

[email]
# The address to send email messages from.
email_from = root@example.com

# List of addresses to send messages to.
email_to = root

# Name of the host to connect to to send email messages.
email_host = localhost

But then below this, there’s another section named [command_email] with some sort of overlapping redundancy:

[command_email]
...

# The address to send email messages from.
email_from = root@example.com

# List of addresses to send messages to.
email_to = root

I admit I’m a bit puzzled. Do I have to keep both sections?

Cheers,

Niki

In the [emitters] sections you can tell it what subsystem to use for reporting.

If you use email (the default, I think) then the [email] section is used for configuration. In this the code makes an SMTP call to a server, so you need to tell it the SMTP server to call.

If you use command_email then the [command_email] section is used. In this it runs a command locally (defaults to mail -Ssendwait -s {subject} -r {email_from} {email_to}) so your local sendmail/postfix/whatever configuration is used.

More details are available here: DNF Automatic — dnf latest documentation

1 Like

Thanks very much for your detailed explanation. Now everything’s clear.