diff options
Diffstat (limited to 'src/Propellor/Property/Postfix.hs')
| -rw-r--r-- | src/Propellor/Property/Postfix.hs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs index cdb7bdee..fbb1ea51 100644 --- a/src/Propellor/Property/Postfix.hs +++ b/src/Propellor/Property/Postfix.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE FlexibleContexts #-} + module Propellor.Property.Postfix where import Propellor @@ -9,13 +11,13 @@ import qualified Data.Map as M import Data.List import Data.Char -installed :: Property +installed :: Property NoInfo installed = Apt.serviceInstalledRunning "postfix" -restarted :: Property +restarted :: Property NoInfo restarted = Service.restarted "postfix" -reloaded :: Property +reloaded :: Property NoInfo reloaded = Service.reloaded "postfix" -- | Configures postfix as a satellite system, which @@ -24,7 +26,7 @@ reloaded = Service.reloaded "postfix" -- The smarthost may refuse to relay mail on to other domains, without -- futher coniguration/keys. But this should be enough to get cron job -- mail flowing to a place where it will be seen. -satellite :: Property +satellite :: Property NoInfo satellite = check (not <$> mainCfIsSet "relayhost") setup `requires` installed where @@ -45,13 +47,17 @@ satellite = check (not <$> mainCfIsSet "relayhost") setup -- | Sets up a file by running a property (which the filename is passed -- to). If the setup property makes a change, postmap will be run on the -- file, and postfix will be reloaded. -mappedFile :: FilePath -> (FilePath -> Property) -> Property +mappedFile + :: Combines (Property x) (Property NoInfo) + => FilePath + -> (FilePath -> Property x) + -> Property (CInfo x NoInfo) mappedFile f setup = setup f `onChange` cmdProperty "postmap" [f] -- | Run newaliases command, which should be done after changing -- </etc/aliases>. -newaliases :: Property +newaliases :: Property NoInfo newaliases = trivial $ cmdProperty "newaliases" [] -- | The main config file for postfix. @@ -59,7 +65,7 @@ mainCfFile :: FilePath mainCfFile = "/etc/postfix/main.cf" -- | Sets a main.cf name=value pair. Does not reload postfix immediately. -mainCf :: (String, String) -> Property +mainCf :: (String, String) -> Property NoInfo mainCf (name, value) = check notset set `describe` ("postfix main.cf " ++ setting) where @@ -96,7 +102,7 @@ mainCfIsSet name = do -- -- Note that multiline configurations that continue onto the next line -- are not currently supported. -dedupMainCf :: Property +dedupMainCf :: Property NoInfo dedupMainCf = fileProperty "postfix main.cf dedupped" dedupCf mainCfFile dedupCf :: [String] -> [String] |
