diff --git a/cookbooks/mailman/files/centos/master.cf b/cookbooks/mailman/files/centos/master.cf index f5516ac..2087147 100644 --- a/cookbooks/mailman/files/centos/master.cf +++ b/cookbooks/mailman/files/centos/master.cf @@ -122,7 +122,7 @@ scache unix - - n - 1 scache #scalemail-backend unix - n n - 2 pipe # flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store # ${nexthop} ${user} ${extension} -# + mailman unix - n n - - pipe flags=FR user=mailman:mailman argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} diff --git a/cookbooks/mailman/recipes/default.rb b/cookbooks/mailman/recipes/default.rb index f5bf9fc..2ee33d3 100644 --- a/cookbooks/mailman/recipes/default.rb +++ b/cookbooks/mailman/recipes/default.rb @@ -83,11 +83,18 @@ cookbook_file '/etc/cron.d/mailman-spb' do mode 0644 end +execute 'postfix:disable-email-prod' do + command "postconf 'default_transport = fs_mail'" + not_if "cat /etc/postfix/main.cf | grep 'default_transport = fs_mail'" + action :nothing +end + cookbook_file '/etc/postfix/master.cf' do unless node['environment'] == "prod" source 'master.cf.development' + notifies :run, 'execute[postfix:disable-email-prod]' end - notifies :reload, 'service[postfix]' + notifies :restart, 'service[postfix]' end execute 'set-mailman-default-list' do -- libgit2 0.21.2