Changeset - 9a5d1122146f
[Not reviewed]
0 4 0
Branko Majic (branko) - 9 years ago 2015-04-07 23:02:48
branko@majic.rs
MAR-4: Added documentation for the mail forwarder role. Removed allowed networks for the mail forwarder role (the server is not supposed to relay mail).
4 files changed with 56 insertions and 7 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -733,3 +733,58 @@ Here is an example configuration for setting-up XMPP server using Prosody:
 
  smtp_allow_relay_from:
 
    - ldap.example.com
 
    - xmpp.example.com
 

	
 

	
 
Mail Forwarder
 
--------------
 

	
 
The ``mail_forwarder`` role can be used for setting-up a local SMTP server for
 
sending out mails and receiving mails for local users. The SMTP server is
 
provided by Postfix.
 

	
 
SMTP service on server set-up this way is not meant to be exposed to the
 
Internet directly, and should receive delivery failures from the relay server
 
instead.
 

	
 
The role implements the following:
 

	
 
* Installs and configures Postfix.
 
* Purges Exim4 configuration (just in case).
 
* Sets-up aliases for the local recipients.
 

	
 
Postfix is configured as follows:
 

	
 
* Local destinations are set-up.
 
* A relay host is set.
 

	
 

	
 
Parameters
 
~~~~~~~~~~
 

	
 
**local_mail_aliases** (dictionary, mandatory)
 
  Dictionary defining the local aliases. Aliases defined this way will either be
 
  appended to default aliases on the server, or replace the existing entries (if
 
  the alias/recipient is already present). Keys in the dictionary are the local
 
  recipients/aliases, while the value provided should be a space-separated list
 
  of mail addresses (or local users) where the mails should be forwarded.
 

	
 
**smtp_relay_host** (string, mandatory)
 
  SMTP server via which the mails are sent out for non-local recipients.
 

	
 

	
 
Examples
 
~~~~~~~~
 

	
 
Here is an example configuration for setting-up the mail forwarder:
 

	
 
.. code-block:: yaml
 

	
 
  ---
 

	
 
  # All mails sent to local user root will be forwarded to external account as
 
  # well.
 
  local_mail_aliases:
 
    root: "root john.doe@example.com"
 

	
 
  smtp_relay_host: mail.example.com
 

	
roles/mail_forwarder/templates/main.cf.j2
Show inline comments
 
@@ -33,7 +33,7 @@ alias_database = hash:/etc/aliases
 
myorigin = /etc/mailname
 
mydestination = {{ inventory_hostname }}, {{ inventory_hostname_short }}, localhost.localdomain, localhost
 
relayhost = {{ smtp_relay_host }}
 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128{% for network in smtp_mynetworks  %} {{ network }}{% endfor %}
 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
 
mailbox_command = procmail -a "$EXTENSION"
 
mailbox_size_limit = 0
 
recipient_delimiter = +
testsite/group_vars/ldap.yml
Show inline comments
 
@@ -3,9 +3,6 @@
 
local_mail_aliases:
 
  root: "root john.doe@example.com"
 

	
 
smtp_mynetworks:
 
  - mail.example.com
 

	
 
smtp_relay_host: mail.example.com
 

	
 
ldap_client_config:
testsite/group_vars/xmpp.yml
Show inline comments
 
@@ -17,9 +17,6 @@ ldap_client_config:
 
local_mail_aliases:
 
  root: "root john.doe@example.com"
 

	
 
smtp_mynetworks:
 
  - mail.example.com
 

	
 
smtp_relay_host: mail.example.com
 

	
 
prosody_administrators:
0 comments (0 inline, 0 general)