diff --git a/doc/guix.texi b/doc/guix.texi index 95e9ebb35bb..64ef5964745 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -29879,6 +29879,7 @@ remote servers. Run @command{man smtpd.conf} for more information. @item @code{log-file} (default: @code{"/var/log/mail.log"}) The file location for the OpenSMTPD log file. Logging occurs in the foreground via the Shepherd, i.e. OpenSMTPD does not detach. +When set to @code{#f} OpenSMTPD will instead detach and log to the syslog. @item @code{setgid-commands?} (default: @code{#t}) Make the following commands setgid to @code{smtpq} so they can be diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index eef46d8f63d..edcc0caa97c 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -1744,8 +1744,11 @@ match from local for any action outbound (documentation "Run the OpenSMTPD daemon.") (start (let ((smtpd (file-append package "/sbin/smtpd"))) #~(make-forkexec-constructor - (list #$smtpd "-d" "-f" #$config-file) - #:log-file #$log-file))) + (list #$smtpd "-f" #$config-file + #$@(if log-file '("-d") '())) + #$@(if log-file + (list #:log-file log-file) + (list #:pid-file "/var/run/smtpd.pid"))))) (stop #~(make-kill-destructor)))))) (define %opensmtpd-accounts