mail_satellite¶
Overview¶
Installs and configures a mail server so that it’s possible to send
emails either through port 25 or by executing the sendmail command.
All email is sent using a
smarthost.
It’s mainly useful in two cases:
Forwarding cron email (otherwise the administrator would need to login to see if any cron email has been received locally.)
Being used as the smarthost of applications or services installed on the server. In this case such applications should be configured to use
localhost:25as the smarthost. While they could be configured to use the smarthost directly, usinglocalhost:25can be useful especially when the smarthost is not in our control, because whenever something doesn’t work we can get some information from Postfix’s logs as to what is going wrong.
Parameters¶
- mail_satellite_mailname
The default domain name that will be used for email addresses that do not contain
@.- mail_satellite_smarthost
The smart host, such as
relay.example.com.- mail_satellite_smarthostport
The smarthost port, such as 25 or 587 (the default). If the outgoing port is 465 or 587, encrypted connections are forced.
- mail_satellite_smarthostusername, mail_satellite_smarthostpassword
The username and password to connect to the smart host. If unspecified it will be connecting unauthenticated.
- mail_satellite_masquerade_domains
Optional. This will be used as Postfix’s masquerade_domains parameter. For example, if
mail_satellite_mailnameisnextcloud.digigov.grnet.gr, you may want to usemail_satellite_masquerade_domains = grnet.grso that the senderroot@nextcloud.digigov.grnet.grwill be converted togrnet.gr.- mail_satellite_canonical_sender
Optional. If set, the sender will be rewritten to this; both the envelope sender and the header sender.
- mail_satellite_mail_aliases
A hash that maps local emails to actual addresses, for example:
mail_satellite_mail_aliases: root: antonis@example.com,panagiotis@example.com www-data: root
You should practically always create an alias for
root, and very often forwww-dataas well, and for everything that uses cron.Note: We don’t use
/etc/aliasesfor this functionality; Postfix only uses/etc/aliasesfor local delivery. We use virtual_alias_maps instead.- mail_satellite_inet_interfaces
If
loopback-only(the default), it listens only on the local interface. Change it toall(or any value accepted by the postfixinet_interfacesparameter) so that it listens on all interfaces. In that case, you need to care about the firewall yourself. For example, assuming you use the base firewall:- name: Allow smtp through firewall lineinfile: path: /etc/nftables/ansible-late.nft line: "ip saddr { 1.2.3.4, 5.6.7.8 } tcp dport smtp accept" notify: Reload nftables
You also need to set
mail_satellite_mynetworks.- mail_satellite_mynetworks
The networks that are allowed to relay. If unset, only the localhost from the local interface is allowed to send emails. If you set it, don’t specify the localhost, this will be included anyway.
See also
mail_satellite_inet_interfaces.
The old unprefixed variable names are still accepted for backwards
compatibility, but new playbooks should use the mail_satellite_*
names above.