I'm setting up email alert for unattended upgrades on ubuntu 18.04. It looks like unattended-upgrades cannot set the 'FROM' address and rely on mailx.
On mailx I'm using SMTP so the from address must be qualified. I get error that the from address is root and not root@mydomain.com
To change this I need to set the 5th parameter in the root user in /etc/passwd file.
Is there no other less intrusive option?
EDIT: Adding ssmtp definitions (changed domain and user/pass for security)
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=nir@domain.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=email-smtp.eu-west-1.amazonaws.com:587
# Where will the mail seem to come from?
rewriteDomain=domain.com
# The full hostname
hostname=domain.com
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
# Use SSL/TLS before starting negotiation
TLS_CA_FILE=/etc/ssl/certs/ca-certificates.crt
UseTLS=NO
UseSTARTTLS=YES
AuthUser=XXX
AuthPass=YYY
AuthMethod=LOGIN
# sSMTP aliases
#
# Format: local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:nir@domain.com:email-smtp.eu-west-1.amazonaws.com:587