rename filters
update to Debian 11
This is an example configuration to run your own email server.
It uses OpenSMTPD, an email server by the OpenBSD developers that is way easier to use than Postfix - you can get it to work with only 10 lines of configuration.
This is meant to be the simplest possible setup for recieving email only for yourself when you have SSH access, in which you case you don't even need to learn Dovecot (the IMAP server) or mbsync, and can download new emails with rsync.
This is tested on Debian and should work anywhere with OpenSMTPD > 6.4 with minor modifications. In particular, if your server doesn't run a Debian-based distro, the service and user are called smtpd
instead of opensmtpd
and the config file is /etc/smtpd/smtpd.conf
instead of /etc/smtpd.conf
. On OpenBSD the filter executables go in /usr/local/libexec/smtpd
, and on Arch in /usr/lib/smtpd/opensmtpd
.
zmodload zsh/net/tcp; ztcp -l 25
, and check that you can connect to it from your machine with zmodload zsh/net/tcp; ztcp your_server.com 25
. Otherwise, you can use netcat.hostnamectl set-hostname $domain
.dns.txt
to see how to set your DNS records.>/dev/null 2>&1
to each cron job line, or switch to systemd timers./etc/rspamd/local.d/dkim_signing.conf
file withallow_username_mismatch = true;
domain {
sender_domain.xyz {
path = "/etc/dkim_private.key";
selector = "mail";
}
}
Then finally run systemctl restart rspamd
./etc/smtpd.conf
if you want, then download this repo's smtpd.conf
to /etc/smtpd.conf
, read the comments and replace the example domains with yours.smtpd -n
.systemctl restart opensmtpd
.sendmail foo@your_domain.xyz
and ensure that it gets saved to the configured maildir, if it doesn't check /var/log/mail.err
.rsync -r --remove-source-files root@server_hostname.com:~mail/smtpd/new ~mail/$USER/INBOX
.