summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Postfix.hs
diff options
context:
space:
mode:
authorJoey Hess2014-07-18 13:09:55 -0400
committerJoey Hess2014-07-18 13:09:55 -0400
commit4d38e8bfd65e935819b6c0ba07d746232de9eb08 (patch)
treec40b4684a5d956b381ea483926922a9831c094ef /src/Propellor/Property/Postfix.hs
parent3907bf5db324809a005a4a1b8a75929e35418044 (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Postfix.hs')
-rw-r--r--src/Propellor/Property/Postfix.hs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs
index 1a4a313a..52c329bd 100644
--- a/src/Propellor/Property/Postfix.hs
+++ b/src/Propellor/Property/Postfix.hs
@@ -31,12 +31,16 @@ satellite = check norelayhost setup
setup = trivial $ property "postfix satellite system" $ do
hn <- asks hostName
let (_, domain) = separate (== '.') hn
- ensureProperty $ Apt.reConfigure "postfix"
- [ ("postfix/main_mailer_type", "select", "Satellite system")
- , ("postfix/root_address", "string", "root")
- , ("postfix/destinations", "string", " ")
- , ("postfix/mailname", "string", hn)
- , ("postfix/relayhost", "string", "smtp." ++ domain)
+ ensureProperties
+ [ Apt.reConfigure "postfix"
+ [ ("postfix/main_mailer_type", "select", "Satellite system")
+ , ("postfix/root_address", "string", "root")
+ , ("postfix/destinations", "string", " ")
+ , ("postfix/mailname", "string", hn)
+ ]
+ , mainCf `containsLine` ("relayhost = " ++ domain)
+ `onChange` dedupMainCf
+ `onChange` reloaded
]
norelayhost = not . any relayhostset . lines
<$> readProcess "postconf" []