From 3729da9c6e1e3daaba98aadfb27f1ac364e75bf8 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 26 Nov 2020 15:19:43 -0300 Subject: vps.scm: Start setting up OpenSMTPD configuration --- sync/vps.scm | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/sync/vps.scm b/sync/vps.scm index a243f03..3a7f2e1 100644 --- a/sync/vps.scm +++ b/sync/vps.scm @@ -1,4 +1,5 @@ -(use-modules (gnu)) +(use-modules (gnu) + (ice-9 textual-ports)) (use-service-modules networking ssh mcron admin) (use-package-modules ssh backup) @@ -11,6 +12,29 @@ root ALL=(ALL) ALL %wheel ALL=NOPASSWD: ALL\n") +(define tld + (string-trim-both (call-with-input-file "tld.txt" get-string-all))) + +(define mail-domain + (string-append "mail." tld)) + +(define aliases-file + (mixed-text-file "euandreh-aliases" " +postmaster root + +@ " user)) + +(define opensmtpd-config + (mixed-text-file "euandreh-smtpd.conf" " +listen on eth0 +table aliases file:/etc/aliases +accept from any domain " mail-domain " alias deliver to maildir +accept for local alias deliver to maildir +accept for any relay + +pki " mail-domain " cert \"/etc/letsencrypt/live/" mail-domain "/fullchain.pem\" +pki " mail-domain " key \"/etc/letsencrypt/live/" mail-domain "/privkey.pem\"")) + (operating-system (locale "fr_FR.UTF-8") (timezone "America/Sao_Paulo") @@ -41,7 +65,11 @@ root ALL=(ALL) ALL (mcron-configuration (jobs (list)))) (service unattended-upgrade-service-type) - (service dhcp-client-service-type)) + (service dhcp-client-service-type) +; (service opensmtdp-service-type +; (opensmtpd-configuration +; (config-file opensmtpd-config))) +) %base-services)) (bootloader (bootloader-configuration -- cgit v1.2.3