From 6fb1de240cd5e966d993cc703cae39735e7b4102 Mon Sep 17 00:00:00 2001
From: Jan Philipp Timme <jan.philipp@timme.it>
Date: Wed, 4 Dec 2019 15:27:11 +0100
Subject: [PATCH] Add README.md, update a bunch of comments

---
 README.md                              | 18 ++++++++++++++++++
 pillar.example                         |  4 ++++
 postfix/nullclient/etc/postfix/main.cf |  6 ++++--
 3 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 README.md
 create mode 100644 pillar.example

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..108682f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,18 @@
+# postfix-nullclient-formula
+
+This is a simple collection of states that replace default exim4 with a postfix installation that acts as a nullclient.
+Throw it onto your machine and it will submit mails easily.
+
+Two things are configurable using pillar:
+
+* relayhost (which server to use for submitting emails)
+* rootmail-destination (which address to forward mail for local users to)
+
+# pillar example
+
+```
+postfix:
+  nullclient:
+    relayhost: 'smtp.hs-hannover.de'
+    rootmail-destination: 'web-rootmails@hs-hannover.de'
+```
diff --git a/pillar.example b/pillar.example
new file mode 100644
index 0000000..ff6628d
--- /dev/null
+++ b/pillar.example
@@ -0,0 +1,4 @@
+postfix:
+  nullclient:
+    relayhost: 'smtp.example.com'
+    rootmail-destination: 'rootmails@example.com'
diff --git a/postfix/nullclient/etc/postfix/main.cf b/postfix/nullclient/etc/postfix/main.cf
index b6e51da..041d508 100644
--- a/postfix/nullclient/etc/postfix/main.cf
+++ b/postfix/nullclient/etc/postfix/main.cf
@@ -1,9 +1,11 @@
+### THIS FILE IS MANAGED BY SALT STATE `postfix.nullclient`
+### YOUR CHANGES WILL BE OVERWRITTEN!
 {% set minion_id = grains['id'] %}
 # Set compatibility level
 compatibility_level = 2
 
 myorigin = /etc/mailname
-smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
+smtpd_banner = $myhostname ESMTP $mail_name
 biff = no
 
 # appending .domain is the MUA's job.
@@ -26,7 +28,7 @@ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
 
 myhostname = {{ minion_id }}
 
-# Forward everything to the OTRS queue
+# Forward emails for local users to this address for easy collection
 alias_maps = static:web-rootmails@hs-hannover.de
 alias_database =
 local_recipient_maps = unix:passwd.byname
-- 
GitLab