Sending to localhost aliases and outside addresses with default a domain name using Postfix on Debian; working config

postfixHow to send to both local users (like root) from cronjobs, and to outside addresses with a default domain added that actually also passes SPF checks.

Related problems / information:

/etc/hosts localhost mercurius



postmaster:     root


myorigin =
masquerade_domains =
append_dot_mydomain = no
myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost, localhost.localdomain


echo test | mail -s test root