How 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:
- Set up postmaster using Postfix
- Get postfix to forward root’s mail
- postfix /etc/mailname
- Postfix address masquerading
/etc/hosts
127.0.0.1 localhost mercurius mercurius.spacedomain.net
/etc/mailname
mercurius.spacedomain.net
/etc/aliases
postmaster: root
root: explorer@moonbase.org
/etc/postfix/main.cf
myorigin = mercurius.spacedomain.net
masquerade_domains = spacedomain.net
append_dot_mydomain = no
myhostname = mercurius.spacedomain.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost, localhost.localdomain
TEST
echo test | mail -s test root