summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-04-14 15:35:29 -0400
committerJoey Hess2014-04-14 15:35:29 -0400
commit8bb029002e547f272e705d92dbc9c4fa53a63d78 (patch)
tree8f6b292925583fd50339a99b7a4a59f22cec1183
parent0b5c5f7c9a4e9b192237669903e954eae84dafd0 (diff)
propellor spin
-rw-r--r--Propellor/Property/Postfix.hs26
-rw-r--r--config-joey.hs7
-rw-r--r--propellor.cabal1
3 files changed, 32 insertions, 2 deletions
diff --git a/Propellor/Property/Postfix.hs b/Propellor/Property/Postfix.hs
new file mode 100644
index 00000000..c253aac2
--- /dev/null
+++ b/Propellor/Property/Postfix.hs
@@ -0,0 +1,26 @@
+module Propellor.Property.Postfix where
+
+import Propellor
+import qualified Propellor.Property.Apt as Apt
+import Propellor.Property.User
+import Utility.SafeCommand
+import Utility.FileMode
+
+import System.PosixCompat
+
+installed :: Property
+installed = Apt.serviceInstalledRunning "postfix"
+
+-- | Configures postfix as a satellite system, which
+-- relats all mail through a relay host, which defaults to smtp.domain.
+--
+-- 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 = Apt.reConfigure "postfix"
+ [ ("postfix/main_mailer_type", "select", "Satellite system")
+ , ("postfix/destinations", "string", "")
+ ]
+ `describe` "postfix satellite system"
+ `requires` installed
diff --git a/config-joey.hs b/config-joey.hs
index 00c811d2..6039a529 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -18,6 +18,7 @@ import qualified Propellor.Property.OpenId as OpenId
import qualified Propellor.Property.Docker as Docker
import qualified Propellor.Property.Git as Git
import qualified Propellor.Property.Apache as Apache
+import qualified Propellor.Property.Postfix as Postfix
import qualified Propellor.Property.SiteSpecific.GitHome as GitHome
import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuilder
import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites
@@ -40,7 +41,9 @@ hosts = -- (o) `
& Apt.unattendedUpgrades
& Network.ipv6to4
& Tor.isBridge
+ & Postfix.satellite
& Docker.configured
+
& cname "shell.olduse.net"
& JoeySites.oldUseNetShellBox
@@ -62,6 +65,7 @@ hosts = -- (o) `
, standardSystem "orca.kitenet.net" Unstable "amd64"
& Hostname.sane
& Apt.unattendedUpgrades
+ & Postfix.satellite
& Docker.configured
& Docker.docked hosts "amd64-git-annex-builder"
& Docker.docked hosts "i386-git-annex-builder"
@@ -79,8 +83,7 @@ hosts = -- (o) `
& Apt.unattendedUpgrades
& Apt.serviceInstalledRunning "ntp"
& Dns.zones myDnsSecondary
-
- & Apt.serviceInstalledRunning "postfix"
+ & Postfix.satellite
& Apt.serviceInstalledRunning "apache2"
& File.hasPrivContent "/etc/ssl/certs/web.pem"
diff --git a/propellor.cabal b/propellor.cabal
index 1d625381..482f2de6 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -81,6 +81,7 @@ Library
Propellor.Property.Network
Propellor.Property.Obnam
Propellor.Property.OpenId
+ Propellor.Property.Postfix
Propellor.Property.Reboot
Propellor.Property.Scheduled
Propellor.Property.Service