add smtpd makefile

This commit is contained in:
Malin Freeborn 2023-06-15 18:52:07 +02:00
parent 65cbec6832
commit d5654854c1
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
3 changed files with 58 additions and 1 deletions

View File

@ -1 +1,17 @@
DMZ Configuration files These setup files provide the text-only configurations for DMZ.
*It should not contain private data.*
# Aspirations
- Each service should reside in its own directory.
- Everything should be automated, including:
- backups,
- turning the backup back into a service,
- configuring the service to run,
- Makefile (or similar) wherever practical,
- Idempotency.
- All secrets stored elsewhere (probably in the `dmzadmin` repo)
- Any maintenance scripts.
- Configurations should reside in shadow-directories, e.g. a backup of `/etc/soft/config` should reside in this repo under `etc/soft/config`.

21
etc/smtpd/smtpd.conf Normal file
View File

@ -0,0 +1,21 @@
# $OpenBSD: smtpd.conf,v 1.10 2018/05/24 11:40:17 gilles Exp $
# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.
table aliases file:/etc/smtpd/aliases
# To accept external mail, replace with: listen on all
#
pki splintrs cert "/etc/letsencrypt/live/splint.rs/fullchain.pem"
pki splintrs key "/etc/letsencrypt/live/splint.rs/privkey.pem"
listen on end0 tls pki splintrs
#action "local" maildir alias <aliases>
action "relay" relay backup
# Uncomment the following to accept external mail for domain "example.org"
#
# match from any for domain "example.org" action "local"
#match for local action "local"
match from any for domain dmz.rs action "relay"

20
smtpd Normal file
View File

@ -0,0 +1,20 @@
# This make file produces the smtp daemon for the current backup domain: splint.rs
# It is missing the cert, so you'll have to make another.
DOMAIN=splint.rs
output: service
/usr/bin/smtp:
pacman -S smtpd
cp etc/smtpd/* /etc/smtpd
smtpd -n
/etc/smtpd/mailname: /usr/bin/smtp
echo $(DOMAIN) > /etc/smtpd/mailname
.PHONY: service
service: /etc/systemd/system/multi-user.target.wants/smtpd.service
/etc/systemd/system/multi-user.target.wants/smtpd.service: /etc/smtpd/mailname
systemctl enable --now smtpd