Initial commit

master
Thor 4 years ago
commit 74ea2dfb6f
  1. 54
      smtpd.conf
  2. 6
      virtual/alias
  3. 3
      virtual/domain
  4. 3
      virtual/mailbox
  5. 3
      virtual/password

@ -0,0 +1,54 @@
# Load and assign certificates for your mail server. You can use the certbot certificate
# for your web domains, so long as it contains your mail server's hostname. This hostname
# needs to match the FQDN hostname of your server or container.
pki host.tld cert "/etc/ssl/cert.pem"
pki host.tld key "/etc/ssl/private/cert.key"
# These tables are referenced as <table-name> in the options below:
# This file contains the passwords for your email accounts, as generated with
# smtpctl encrypt <password> (alternatively, leave the password for stdin input)
table vpassword "/etc/smtpd/virtual/password"
# This file contains a list of your virtual domains (should not include the local domain)
table vdomain "/etc/smtpd/virtual/domain"
# This file contains a list of emails you want to route to your email accounts
table valias "/etc/smtpd/virtual/alias"
# This file contains a list of UIDs, GIDs and home directories for your email accounts
# For a virtual host setup, you would typically create a UNIX user.group like vmail.vmail
# and chown all your mailbox directories to it.
table vmailbox "/etc/smtpd/virtual/mailbox"
# Listen to the various SMTP ports, using the keys we loaded above to prove we are host.tld
listen on eth0 tls pki host.tld
listen on eth0 port 465 smtps pki host.tld auth <vpassword>
listen on eth0 port 587 tls-require pki host.tld auth <vpassword>
# These are actions that get triggered by the match rules below:
# Action to receive mail locally and send it to a maildir (~/Maildir by default but
# here we put them straight in the user's home directory as listed in <vmailbox>).
# The manpage doesn't mention it, but the order of these clauses is significant;
# you will get a syntax error if you don't follow the listing order in the manpage.
action receive maildir "%{user.directory}" userbase <vmailbox> virtual <valias>
# Action to send mail to remote SMTP server
action send relay
# Match mail from any source to your local domain (server hostname)
match from any for local action receive
# Match mail from any source to your virtual domains
match from any for domain <vdomain> action receive
# Match mail from your local network to anywhere (useful for contaners that sit on
# the same subnet and need to send email without authentication)
#match from src x.x.x.x/x for any action send
# This accepts mail from your local machine to anywhere (typical configuration)
match from local for any action send
# This accepts mail from any authenticated user to anywhere
match from any auth for any action send

@ -0,0 +1,6 @@
user1@vhost.tld vmail
user2@vhost.tld vmail
user3@vhost.tld vmail
@vhost1.tld vmail
@vhost2.tld vmail
@vhost3.tld vmail

@ -0,0 +1,3 @@
vhost1.tld
vhost2.tld
vhosr3.tld

@ -0,0 +1,3 @@
user1 999:999:/home/user1
user2 999:999:/home/user2
user3 999:999:/home/user3

@ -0,0 +1,3 @@
user1 smtpctl-generated-password-1
user2 smtpctl-generated-password-2
user3 smtpctl-generated-password-3
Loading…
Cancel
Save