Commit 24cf7ab31aef05151f84e08a9c088455e4f3660c
Exists in
master
and in
26 other branches
Merge branch 'disable_email_dev' into 'master'
Disable email dev Adicionamos uma verificação para não enviar email dos ambientes de dev. - Via postconf alteramos o arquivo main.cf para escrever os emails em /var/tmp/fs_mail.dump - Criamos um template master.cf.development para ambientes que não forem de produção; See merge request !135
Showing
3 changed files
with
17 additions
and
1 deletions
Show diff stats
config/dev/config.yaml
cookbooks/mailman/files/centos/master.cf
... | ... | @@ -122,7 +122,12 @@ scache unix - - n - 1 scache |
122 | 122 | #scalemail-backend unix - n n - 2 pipe |
123 | 123 | # flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store |
124 | 124 | # ${nexthop} ${user} ${extension} |
125 | -# | |
125 | + | |
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,6 +83,16 @@ cookbook_file '/etc/cron.d/mailman-spb' do |
83 | 83 | mode 0644 |
84 | 84 | end |
85 | 85 | |
86 | +execute 'postfix:disable-send-emails' do | |
87 | + command "postconf 'default_transport = fs_mail'" | |
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']}" | |
94 | +end | |
95 | + | |
86 | 96 | cookbook_file '/etc/postfix/master.cf' do |
87 | 97 | notifies :reload, 'service[postfix]' |
88 | 98 | end | ... | ... |