Parameterize smtpd service
modules/config/mail.scm
41 | 41 | @yahoo.com.cn | |
42 | 42 | @qq.com")) | |
43 | 43 | ||
44 | - | (define opensmtpd-conf | |
44 | + | (define (opensmtpd-conf interface domain) | |
45 | 45 | (mixed-text-file "smtpd.conf" " | |
46 | 46 | # This is the smtpd server system-wide configuration file. | |
47 | 47 | # See smtpd.conf(5) for more information. | |
48 | 48 | ||
49 | 49 | # My TLS certificate and key | |
50 | - | pki lepiller.eu certificate \"/etc/letsencrypt/live/lepiller.eu/fullchain.pem\" | |
51 | - | pki lepiller.eu key \"/etc/letsencrypt/live/lepiller.eu/privkey.pem\" | |
50 | + | pki lepiller.eu certificate \"/etc/letsencrypt/live/" domain "/fullchain.pem\" | |
51 | + | pki lepiller.eu key \"/etc/letsencrypt/live/" domain "/privkey.pem\" | |
52 | 52 | ||
53 | 53 | # Edit this file to add more virtual users (passwords are read in that file | |
54 | 54 | # instead of /etc/passwd. | |
… | |||
56 | 56 | ||
57 | 57 | # port 25 is used only for receiving from external servers, and they may start a | |
58 | 58 | # TLS session if the want. | |
59 | - | listen on ens18 port 25 tls pki lepiller.eu | |
59 | + | listen on " interface " port 25 tls pki lepiller.eu | |
60 | 60 | # For sending messages from outside of this server, you need to authenticate and | |
61 | 61 | # use TLS. | |
62 | - | listen on ens18 port 587 tls-require pki lepiller.eu auth <passwd> | |
62 | + | listen on " interface " port 587 tls-require pki lepiller.eu auth <passwd> | |
63 | 63 | # On this server, you only need to authenticate on one of the available ports, | |
64 | 64 | # and you may use TLS. | |
65 | 65 | listen on lo port 25 tls pki lepiller.eu auth <passwd> | |
… | |||
87 | 87 | accept for local alias <aliases> deliver to maildir | |
88 | 88 | ")) | |
89 | 89 | ||
90 | - | (define lepiller-imap-service | |
90 | + | (define (lepiller-imap-service domain) | |
91 | 91 | (service dovecot-service-type | |
92 | 92 | (dovecot-configuration | |
93 | 93 | (mail-location "maildir:~/Maildir") | |
94 | - | (ssl-cert "</etc/letsencrypt/live/lepiller.eu/fullchain.pem") | |
95 | - | (ssl-key "</etc/letsencrypt/live/lepiller.eu/privkey.pem")))) | |
94 | + | (ssl-cert (string-append | |
95 | + | "</etc/letsencrypt/live/" domain "/fullchain.pem")) | |
96 | + | (ssl-key (string-append | |
97 | + | "</etc/letsencrypt/live/" domain "/privkey.pem"))))) | |
96 | 98 | ||
97 | - | (define lepiller-smtp-service | |
99 | + | (define (lepiller-smtp-service interface domain) | |
98 | 100 | (service opensmtpd-service-type | |
99 | 101 | (opensmtpd-configuration | |
100 | - | (config-file opensmtpd-conf)))) | |
102 | + | (config-file (opensmtpd-conf interface domain))))) | |
101 | 103 | ||
102 | - | (define lepiller-mail-services | |
104 | + | (define* (lepiller-mail-services #:key interface domain) | |
103 | 105 | (list | |
104 | - | lepiller-smtp-service | |
105 | - | lepiller-imap-service)) | |
106 | + | (lepiller-smtp-service interface domain) | |
107 | + | (lepiller-imap-service domain))) |
systems/ene.scm
61 | 61 | (zones (list lepiller-master-zone | |
62 | 62 | ipv4-reverse-master-zone | |
63 | 63 | ipv6-reverse-master-zone)))) | |
64 | - | (certbot-service `(("courriel.lepiller.eu") | |
64 | + | (certbot-service `(("courriel.lepiller.eu" "smtp.lepiller.eu") | |
65 | 65 | ("ene.lepiller.eu" "rennes.lepiller.eu") | |
66 | 66 | ("avatar.lepiller.eu"))) | |
67 | 67 | (cat-avatar-generator-service | |
… | |||
73 | 73 | (listen '("443 ssl http2" "[::]:443 ssl http2")))) | |
74 | 74 | (simple-service 'default-http-server nginx-service-type | |
75 | 75 | (list (nginx-server-configuration | |
76 | - | (ssl-certificate "/etc/letsencrypt/live/lepiller.eu/fullchain.pem") | |
77 | - | (ssl-certificate-key "/etc/letsencrypt/live/lepiller.eu/privkey.pem") | |
76 | + | (ssl-certificate "/etc/letsencrypt/live/ene.lepiller.eu/fullchain.pem") | |
77 | + | (ssl-certificate-key "/etc/letsencrypt/live/ene.lepiller.eu/privkey.pem") | |
78 | 78 | (listen '("443 ssl http2" "[::]:443 ssl http2")) | |
79 | 79 | (server-name '(default))(root "/srv/http/default"))))) | |
80 | - | lepiller-mail-services | |
80 | + | (lepiller-mail-services | |
81 | + | #:interface "eth0" | |
82 | + | #:domain "courriel.lepiller.eu") | |
81 | 83 | (server-services "ene")))) |
systems/hermes.scm
87 | 87 | (ssl-certificate-key "/etc/letsencrypt/live/lepiller.eu/privkey.pem") | |
88 | 88 | (listen '("443 ssl http2" "[::]:443 ssl http2")) | |
89 | 89 | (server-name '(default))(root "/srv/http/default"))))) | |
90 | - | lepiller-mail-services | |
90 | + | (lepiller-mail-services | |
91 | + | #:interface "ens18" | |
92 | + | #:domain "lepiller.eu") | |
91 | 93 | (server-services "hermes")))) |