Hello,

how do I setup smtpd so that it automatically puts emails that were sent to user+...@domain.tld into the user's tag folder, only if it exists.
Example:
If I receive emails on "benni+open...@stuerz.xyz", I want them to be put into my "OpenBSD" folder. At the moment I get them into my inbox.

I think this line has to be changed:
action "domain_mail" maildir "/var/vmail/%{dest.domain:lowercase}/%{dest.user:lowercase|strip}/Inbox" virtual <virtuals>

I probably want the "Inbox" part to be replaced with a small shell script. If this is the case, how do I do it?

Have a good day,
Benjamin Stürz

My full smtpd.conf:
#       $OpenBSD: smtpd.conf,v 1.14 2019/11/26 20:14:38 gilles Exp $

# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.

pki "mail" cert "/etc/ssl/mixdown.me.fullchain.pem"
pki "mail" key "/etc/ssl/private/mixdown.me.key"

table aliases file:/etc/mail/aliases
table credentials file:/etc/mail/credentials.smtpd
table virtuals file:/etc/mail/virtuals

filter dkim_sign proc-exec "filter-dkimsign -d mixdown.me -s selector1 -k /etc/mail/dkim/mixdown.me.key" user _dkimsign group _dkimsign
filter rspamd proc-exec "/usr/local/libexec/smtpd/filter-rspamd"
filter filters chain { dkim_sign, rspamd }

listen on all tls pki "mail"
listen on egress port submission tls-require pki "mail" auth <credentials> filter "filters" listen on egress port smtps tls-require pki "mail" auth <credentials> filter "filters"

action "local_mail" mbox alias <aliases>
action "domain_mail" maildir "/var/vmail/%{dest.domain:lowercase}/%{dest.user:lowercase|strip}/Inbox" virtual <virtuals>
action "outbound" relay

match from any for domain "mixdown.me" action "domain_mail"
match from any for domain "stuerz.art" action "domain_mail"
match from any for domain "stuerz.xyz" action "domain_mail"
match from local for local action "local_mail"
match from auth for any action "outbound"
match from local for any action "outbound"
match from any for any reject


Reply via email to