aboutsummaryrefslogtreecommitdiff
path: root/src/xyz
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-12 09:09:09 -0300
committerEuAndreh <eu@euandre.org>2023-03-12 09:09:09 -0300
commit67cf1ea2a2358fb86f8f3fce919141b6cc555353 (patch)
treebe8938833ad4473a41c171b67609df9ed4a96877 /src/xyz
parentqueue.scm: Add "home_mailbox" compat config (diff)
downloadpackage-repository-67cf1ea2a2358fb86f8f3fce919141b6cc555353.tar.gz
package-repository-67cf1ea2a2358fb86f8f3fce919141b6cc555353.tar.xz
queue.scm: Add "mail-in-home?" option for dovecot and postfix services
Diffstat (limited to 'src/xyz')
-rw-r--r--src/xyz/euandreh/queue.scm18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/xyz/euandreh/queue.scm b/src/xyz/euandreh/queue.scm
index 418f52d..1470ae7 100644
--- a/src/xyz/euandreh/queue.scm
+++ b/src/xyz/euandreh/queue.scm
@@ -762,6 +762,7 @@ keyfile ~a/private.key
make-postfix-configuration
postfix-configuration?
(postfix postfix-configuration-postfix (default postfix))
+ (mail-in-home? postfix-configuration-mail-in-home? (default #f))
(set-sendmail? postfix-configuration-set-sendmail? (default #t))
(master.cf-file postfix-configuration-master.cf-file (default #f))
(main.cf-file postfix-configuration-main.cf-file (default #f))
@@ -856,7 +857,7 @@ dksign unix - - n - - smtp
(define (generate-main.cf config)
(match-record config <postfix-configuration>
- (postfix queue-directory data-directory user setgid-group hostname main.cf-extra)
+ (postfix mail-in-home? queue-directory data-directory user setgid-group hostname main.cf-extra)
(format #f
"
compatibility_level = 3.6
@@ -874,7 +875,7 @@ alias_maps = hash:/etc/aliases
header_checks = regexp:{ { /^Received:.*/ IGNORE }, { /^X-Originating-IP:.*/ IGNORE } }
-home_mailbox = Mail/Inbox/
+~a
smtpd_use_tls = yes
smtpd_tls_cert_file = ~a
@@ -910,6 +911,10 @@ milter_default_action = accept
setgid-group
hostname
+ (if mail-in-home?
+ "home_mailbox = Mail/Inbox/"
+ "mail_spool_directory = /var/mail/")
+
(cert-for "" config)
(key-for "" config)
main.cf-extra)))
@@ -1167,6 +1172,7 @@ max_age: 604800
make-dovecot2-configuration
dovecot2-configuration?
(dovecot2 dovecot2-configuration-dovecot2 (default dovecot))
+ (mail-in-home? dovecot2-configuration-mail-in-home? (default #f))
(raw-file dovecot2-configuration-raw-file (default #f))
(extra-content dovecot2-configuration-extra-content (default ""))
(config-name dovecot2-configuration-config-name (default "dovecot2.conf"))
@@ -1181,7 +1187,7 @@ max_age: 604800
(define (generate-dovecot-config config)
(match-record config <dovecot2-configuration>
- (user group auth-worker-group untrusted-user
+ (mail-in-home? user group auth-worker-group untrusted-user
hostname base-dir state-dir extra-content)
(format #f
"
@@ -1214,7 +1220,7 @@ state_dir = ~a
verbose_proctitle = yes
-mail_location = maildir:~~/Mail:INBOX=~~/Mail/Inbox:LAYOUT=fs
+mail_location = maildir:~a:INBOX=~a/Inbox:LAYOUT=fs"
# FIXME:
# mail_plugins
@@ -1255,6 +1261,10 @@ namespace inbox {
state-dir
base-dir
state-dir
+
+ (if mail-in-home? "~/Mail" "/var/mail/%u")
+ (if mail-in-home? "~/Mail" "/var/mail/%u")
+
extra-content)))
(define (dovecot2-etc-files config)