#OpenSMTPd Quest: 3 – Relaying Email Out & Domains

This configuration adds the ability to relay email out if it originates from an "authenticated" smtp connection, meaning a configured user can use this server to send email out to the world.

Notice that "submission" is an option, this makes an alternative port available to senders at smtp is often filtered from household connections by ISP's

I had to remind myself when looking back on this version of the config that a password file is not needed because OpenSMTPD is reverting to local users, so we can require authentication but not yeat refer auth to a file with credentials

Still no anti-spam features or IMAP or anything like that. Please dont use this for production, this is a config provided for demonstration purposes.

##### Aliases ##### ext_if = "fxp0" table aliases db:/etc/mail/aliases.db table domains file:/etc/mail/domains ##### Pki ###### pki hostname.domain.com key "/etc/letsencrypt/live/your.domain.com/privkey.pem" pki hostname.domain.com cert "/etc/letsencrypt/live/your.domain.com/fullchain.pem" ##### Basic Functions ##### listen on $ext_if tls pki your.domain.com auth-optional listen on $ext_if smtps pki your.domain.com auth listen on $ext_if port submission tls-require pki your.domain.com auth action "local" maildir alias action "outbound" relay ##### Matching rules required for anything to happen ###### match from any for local action "local" match auth from for any action "outbound" ##### More complex rules for relay control options ###### smtp max-message-size 50M

A wild "domains" appeared! Here's what that looks like:

hostname.domain.tld domain.tld

This will simplify expanding the list of domains hosted from this server later.