/etc/opensmtpd/smtpd.conf (2)

From RaySoft
# ------------------------------------------------------------------------------
# smtpd.conf
# ==========
#
# Project   Fedora 4 Shuttle DS57Ux
# Scope     Native
# Copyright (C) 2024 by RaySoft, Zurich, Switzerland
# License   GNU General Public License (GPL) 2.0
#           https://www.gnu.org/licenses/gpl2.txt
#
# ------------------------------------------------------------------------------

# Listens on the localhost interface using IPv4
listen on lo inet4

# Listens on the Podman interface using IPv4
listen on cni-podman0 inet4

# Adds the table 'secrets' which contains the Gmail user and password
table secrets db:/etc/opensmtpd/secrets.db

# Adds the table 'catchall' which is defined inline and catches all
# recipients and redirect them to 'alex.the.lion@gmail.com'
table catchall { "@" = "alex.the.lion@gmail.com" }

# Defines the action 'local' which delivers to the user's mbox using the
# table 'catchall'
action "local" mbox virtual <catchall>

# Defines the action 'relay' which forwards mails to Gmail
action "relay" relay host smtp+tls://gmail@smtp.gmail.com:587 auth <secrets>

# Mails sent from any source are processed with the action 'local'
match from any action "local"

# Mails sent from a local IP address are processed with the action 'relay'
match from local for any action "relay"

# ------------------------------------------------------------------------------

Usage

See OpenSMTPD Howto (2)