Commit 4fa4749ceecb4a13dc8e9d510968ccc1bb63fc55
1 parent
53470c08
Exists in
disable_email_dev
Defines variable to write mailman's emails in file
Showing
3 changed files
with
14 additions
and
8 deletions
Show diff stats
config/dev/config.yaml
cookbooks/mailman/files/centos/master.cf
... | ... | @@ -126,3 +126,8 @@ scache unix - - n - 1 scache |
126 | 126 | mailman unix - n n - - pipe |
127 | 127 | flags=FR user=mailman:mailman argv=/usr/lib/mailman/bin/postfix-to-mailman.py |
128 | 128 | ${nexthop} ${user} |
129 | + | |
130 | +fs_mail unix - n n - - pipe | |
131 | + flags=F user=spb argv=tee --append /var/tmp/fs_mail.dump | |
132 | + | |
133 | + | ... | ... |
cookbooks/mailman/recipes/default.rb
... | ... | @@ -83,16 +83,16 @@ cookbook_file '/etc/cron.d/mailman-spb' do |
83 | 83 | mode 0644 |
84 | 84 | end |
85 | 85 | |
86 | -execute 'postfix:disable-email-prod' do | |
86 | +execute 'postfix:disable-send-emails' do | |
87 | 87 | command "postconf 'default_transport = fs_mail'" |
88 | - not_if "cat /etc/postfix/main.cf | grep 'default_transport = fs_mail'" | |
89 | - action :nothing | |
88 | + only_if "#{node['config']['disable_send_emails']}" | |
89 | +end | |
90 | + | |
91 | +execute 'postfix:enable-send-emails' do | |
92 | + command "postconf 'default_transport = smtp'" | |
93 | + not_if "#{node['config']['disable_send_emails']}" | |
90 | 94 | end |
91 | 95 | |
92 | 96 | cookbook_file '/etc/postfix/master.cf' do |
93 | - unless node['environment'] == "prod" | |
94 | - source 'master.cf.development' | |
95 | - notifies :run, 'execute[postfix:disable-email-prod]' | |
96 | - end | |
97 | - notifies :restart, 'service[postfix]' | |
97 | + notifies :reload, 'service[postfix]' | |
98 | 98 | end | ... | ... |