diff --git a/states/email-satellite/aliases/aliases b/states/email-satellite/aliases/aliases new file mode 100644 index 0000000..b71d63b --- /dev/null +++ b/states/email-satellite/aliases/aliases @@ -0,0 +1,15 @@ +# /etc/aliases +mailer-daemon: postmaster +postmaster: root +nobody: root +hostmaster: root +usenet: root +news: root +webmaster: root +www: root +ftp: root +abuse: root +noc: root +security: root + +root: jim@lunch.org.uk diff --git a/states/email-satellite/exim4/update-exim4.conf.conf b/states/email-satellite/exim4/update-exim4.conf.conf new file mode 100644 index 0000000..09de706 --- /dev/null +++ b/states/email-satellite/exim4/update-exim4.conf.conf @@ -0,0 +1,31 @@ +# /etc/exim4/update-exim4.conf.conf +# +# Edit this file and /etc/mailname by hand and execute update-exim4.conf +# yourself or use 'dpkg-reconfigure exim4-config' +# +# Please note that this is _not_ a dpkg-conffile and that automatic changes +# to this file might happen. The code handling this will honor your local +# changes, so this is usually fine, but will break local schemes that mess +# around with multiple versions of the file. +# +# update-exim4.conf uses this file to determine variable values to replace +# the DEBCONFsomethingDEBCONF strings in the configuration template files. +# +# Most settings found in here do have corresponding questions in the +# Debconf configuration, but not all of them. +# +# This is a Debian specific file + +dc_eximconfig_configtype='satellite' +dc_other_hostnames='' +dc_local_interfaces='127.0.0.1 ; ::1' +dc_readhost='' +dc_relay_domains='' +dc_minimaldns='false' +dc_relay_nets='' +dc_smarthost='scabbers.lunch.org.uk' +CFILEMODE='644' +dc_use_split_config='false' +dc_hide_mailname='' +dc_mailname_in_oh='true' +dc_localdelivery='mail_spool' diff --git a/states/email-satellite/init.sls b/states/email-satellite/init.sls new file mode 100644 index 0000000..5b28cb7 --- /dev/null +++ b/states/email-satellite/init.sls @@ -0,0 +1,33 @@ +exim4: + pkg.installed: + - name: exim4-daemon-light + +exim4_conf: + file.recurse: + - name: /etc/exim4 + - dir_mode: '0755' + - file_mode: '0644' + - source: salt://email-satellite/exim4 + +exim4_update_conf: + cmd.run: + - name: update-exim4.conf + - onchanges: + - file: exim4_conf + +enable_exim4_service: + service.enabled: + - name: exim4 + +exim4_service: + service.running: + - name: exim4 + - reload: true + - watch: + - cmd: exim4_update_conf + +email_aliases: + file.recurse: + - name: /etc + - file_mode: '0644' + - source: salt://email/aliases diff --git a/states/email/exim4/update-exim4.conf.conf b/states/email/exim4/update-exim4.conf.conf index 5e397f1..34ec248 100644 --- a/states/email/exim4/update-exim4.conf.conf +++ b/states/email/exim4/update-exim4.conf.conf @@ -22,7 +22,7 @@ dc_local_interfaces='' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' -dc_relay_nets='' +dc_relay_nets='hedwig.lunch.org.uk' dc_smarthost='"${if match{${lc:$header_from:}}{.*acm.org}{smtpauth.mailroute.net::587}{smtpout.mythic-beasts.com}}"' CFILEMODE='644' dc_use_split_config='true' diff --git a/states/top.sls b/states/top.sls index b9615c7..5f55b2c 100644 --- a/states/top.sls +++ b/states/top.sls @@ -10,6 +10,7 @@ base: - backup - backup/hedwig - certificates/client + - email-satellite - fail2ban - firewalls/hedwig - lunch_website