aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-12-09 23:04:36 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-12-09 23:04:36 -0700
commitb6283709c3813c6b1e357a073880b2a9ceb2e703 (patch)
treea027323d547b13458f66583f96708db306297018
parentd9fc9b544664867e89fab80862227be6b69a5a7c (diff)
downloadconsfigurator-b6283709c3813c6b1e357a073880b2a9ceb2e703.tar.gz
add POSTFIX:DAEMON-SOCKET-DIRECTORY
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/package.lisp6
-rw-r--r--src/property/postfix.lisp13
2 files changed, 17 insertions, 2 deletions
diff --git a/src/package.lisp b/src/package.lisp
index 1c9cba2..c56de79 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -825,11 +825,13 @@
(#:service #:consfigurator.property.service)
(#:apt #:consfigurator.property.apt)
(#:os #:consfigurator.property.os)
- (#:file #:consfigurator.property.file))
+ (#:file #:consfigurator.property.file)
+ (#:user #:consfigurator.property.user))
(:export #:installed
#:reloaded
#:main-configured
- #:mapped-file))
+ #:mapped-file
+ #:daemon-socket-directory))
(package :consfigurator.property.cron
(:local-nicknames (#:re #:cl-ppcre)
diff --git a/src/property/postfix.lisp b/src/property/postfix.lisp
index a33bbbd..82a2ae2 100644
--- a/src/property/postfix.lisp
+++ b/src/property/postfix.lisp
@@ -55,3 +55,16 @@ defaults to the first argument to PROPAPP."
(apply f args))
(file:does-not-exist (strcat (unix-namestring file) ".db")))
:args (cdr propapp)))
+
+(defproplist daemon-socket-directory :posix
+ (daemon-user &optional (daemon-group daemon-user) (name daemon-user)
+ &aux (dir (ensure-directory-pathname
+ (merge-pathnames name #P"/var/spool/postfix/"))))
+ "Create directory NAME in /var/spool/postfix in which a daemon can create a
+Unix domain socket for communication with Postfix. Commonly used for milters
+like OpenDKIM, OpenDMARC, etc.."
+ (:desc #?"Postfix daemon socket directory created for ${daemon-user}")
+ (installed)
+ (file:directory-exists dir)
+ (file:has-ownership dir :user daemon-user :group daemon-group)
+ (file:has-mode dir #o750) (user:has-groups "postfix" daemon-group))