Skip to content

Instantly share code, notes, and snippets.

@lordcirth
Created February 13, 2018 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lordcirth/41f242b7578e2c61f8cc14a6fc83011b to your computer and use it in GitHub Desktop.
Save lordcirth/41f242b7578e2c61f8cc14a6fc83011b to your computer and use it in GitHub Desktop.
# Manage /root/.forward to forward emails
# Configure local postfix to forward root's email to a logging address
# Pillar var 'common:root_forward_to' must be set if this is used
common_root_forward_pkgs:
pkg.installed:
- pkgs:
- postfix
- mailutils
common_root_forward:
file.managed:
- name: /root/.forward
- source: salt://{{tpldir}}/forward
- template: jinja
common_root_forward_service:
service.running:
- name: postfix
- enable: True
- reload: True
- require:
- pkg: common_root_forward_pkgs
- watch:
- file: common_root_forward
- file: common_root_forward_localonly
# postfix should only listen to localhost
common_root_forward_localonly:
file.replace:
- name: /etc/postfix/main.cf
- pattern: '^inet_interfaces = all$'
- repl: 'inet_interfaces = loopback-only'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment