summaryrefslogtreecommitdiff
path: root/puppet/modules/site_postfix/templates/virtual-aliases.erb
blob: 8373de97c0450f67828187bdab2e06fcc65d1d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# This file is managed by puppet.
#
# These virtual aliases take precedence over all other aliases.
#

#
# enable these virtual domains:
#
<%= @domain %> enabled
<%- @aliases.keys.map {|addr| addr.split('@')[1] }.compact.sort.uniq.each do |virt_domain| -%>
<%= virt_domain %> enabled
<%- end %>

#
# virtual aliases:
#
<%- @aliases.keys.sort.each do |from| -%>
<%-   full_address = from =~ /@/ ? from : from + "@" + @domain -%>
<%= full_address %> <%= [@aliases[from]].flatten.map{|a| a =~ /@/ ? a : a + "@" + @domain}.join(', ') %>
<%- end -%>