Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
infra
ansible-shared
communication
Commits
666f64d0
Commit
666f64d0
authored
Jan 31, 2018
by
Hinrikus Wolf
Browse files
postfix: test and fix virtual aliases
parent
5486148d
Changes
6
Hide whitespace changes
Inline
Side-by-side
postfix/files/dynamicmaps.cf
deleted
100644 → 0
View file @
5486148d
sqlite postfix-sqlite.so dict_sqlite_open
pcre postfix-pcre.so dict_pcre_open
postfix/handlers/main.yml
View file @
666f64d0
...
...
@@ -3,3 +3,9 @@
-
name
:
restart postfix
service
:
name=postfix state=restarted
-
name
:
postmap system
command
:
postalias cdb:/etc/aliases
-
name
:
postmap virtual
command
:
postmap cdb:/etc/postfix/virtual
postfix/tasks/main.yml
View file @
666f64d0
...
...
@@ -5,6 +5,7 @@
with_items
:
-
postfix
-
postfix-pcre
-
postfix-cdb
tags
:
-
postfix
-
mail
...
...
@@ -12,7 +13,6 @@
-
name
:
ensure not templated config is present
copy
:
src=files/{{ item }} dest=/etc/postfix/
with_items
:
-
dynamicmaps.cf
-
login_maps.pcre
-
master.cf
-
sender_login_map.hash
...
...
@@ -32,6 +32,22 @@
tags
:
-
postfix
-
mail
-
name
:
ensure system alias database is present
template
:
src=templates/aliases.j2 dest=/etc/aliases
notify
:
-
postmap system
tags
:
-
postfix
-
mail
-
name
:
ensure virtual alias database is present
template
:
src=templates/v_aliases.j2 dest=/etc/postfix/virtual
notify
:
-
postmap virtual
tags
:
-
postfix
-
mail
-
meta
:
flush_handlers
...
...
postfix/templates/aliases.j2
0 → 100644
View file @
666f64d0
{% for alias in system_aliases %}
{{ alias.src }}:{{ alias.dest }}
{% endfor %}
postfix/templates/main.cf.j2
View file @
666f64d0
...
...
@@ -39,8 +39,8 @@ smtpd_relay_restrictions =
permit_sasl_authenticated
defer_unauth_destination
myhostname = {{ ansible_fqdn }}
alias_maps =
hash
:/etc/aliases
alias_database =
hash
:/etc/aliases
alias_maps =
cdb
:/etc/aliases
alias_database =
cdb
:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost
relayhost =
...
...
@@ -50,16 +50,13 @@ recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_mailbox_domains = $mydestination,
wolfscloud.de
virtual_mailbox_domains = $mydestination,
{{ virtual_domains | join(" ") }}
virtual_mailbox_base = /var/vmail/
virtual_mailbox_limit = 512000000
virtual_minimum_uid = 5000
virtual_transport = lmtp:unix:private/dovecot-lmtp
#virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
#local_transport = virtual
virtual_alias_maps = hash:/etc/postfix/virtual
#smtpd_sender_login_maps = hash:/etc/postfix/sender_login_map
virtual_alias_maps = cdb:/etc/postfix/virtual
smtpd_sender_login_maps = proxy:pcre:/etc/postfix/login_maps.pcre
################################################################################
...
...
postfix/templates/v_aliases.j2
0 → 100644
View file @
666f64d0
{% for domain in virtual_domains %}
postmaster@{{ domain }} {{ adminaddr }}
hostmaster@{{ domain }} {{ adminaddr }}
abuse@{{ domain }} {{ adminaddr }}
{% endfor %}
{% for alias in virtual_aliases %}
{{ alias.src }} {{ alias.dest }}
{% endfor %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment