Commit 91a1d11469e454f702a796718b74754ed3bf6fdc
1 parent
0190f0ad
Exists in
master
and in
67 other branches
relay: support an external outgoing relay
Showing
2 changed files
with
8 additions
and
0 deletions
Show diff stats
config/homologa/config.yaml
| ... | ... | @@ -11,5 +11,6 @@ lists_hostname: listas.homologa.softwarepublico.gov.br |
| 11 | 11 | lists_admin: nayanne.bonifacio@planejamento.gov.br |
| 12 | 12 | relay_hostname: relay.homologa.softwarepublico.gov.br |
| 13 | 13 | relay_ip: 189.9.151.66 |
| 14 | +external_outgoing_mail_relay: 189.9.150.53 | |
| 14 | 15 | alt_ssh_port: 55555 |
| 15 | 16 | from_address: noreply@homologa.softwarepublico.gov.br | ... | ... |
cookbooks/email/recipes/relay.rb
| ... | ... | @@ -46,3 +46,10 @@ execute 'transport:postmap' do |
| 46 | 46 | command "postmap /etc/postfix/transport" |
| 47 | 47 | action :nothing |
| 48 | 48 | end |
| 49 | + | |
| 50 | +external_relay = node['config']['external_outgoing_mail_relay'] | |
| 51 | +if external_relay | |
| 52 | + execute "postconf relayhost=#{external_relay}" | |
| 53 | +else | |
| 54 | + execute 'postconf -X relayhost' | |
| 55 | +end | ... | ... |