Here is my complete smtpd.conf. I actually don't use lmtp because I
need to take advantage of spam checking. I use rspamd for spam
checking. You can see that I use multiple domains as well. Gilles was
kind enough to suggest using a wrapper and boy did it make things much
more easy to read.

pki mail cert "/etc/ssl/smtpd.crt"
pki mail key "/etc/ssl/private/smtpd.key"

mda wrapper antispam "/usr/local/bin/rspamc --mime -e '%{mda}'"

table aliases file:/etc/mail/aliases
table addrnames file:/etc/mail/addrnames
table credentials file:/etc/mail/credentials
table domains file:/etc/mail/domains
table virtuals file:/etc/mail/virtuals
table userinfo file:/etc/mail/userinfo
table rejects file:/etc/mail/rejects

# Listeners
#
listen on lo0
listen on lo0 port 10028 tag DKIM
listen on vio0 tls pki mail hostnames <addrnames>
listen on vio0 port 587 tls-require pki mail auth <credentials> \
        hostnames <addrnames>

# Actions
#
action "local" maildir "/var/vmail/%{dest.domain}/%{dest.user}" junk
wrapper "antispam" alias <aliases>
action "domain" maildir "/var/vmail/%{dest.domain}/%{dest.user}" junk
wrapper "antispam" userbase <userinfo> virtual <virtuals>
action "dkim" relay host smtp://127.0.0.1:10027
action "relay" relay

# Incoming
#
match from any mail-from <rejects> for any reject
match from local for local action "local"
match from any for domain <domains> action "domain"

# Outgoing
#
match tag DKIM for any action "relay"
match from local for any action "dkim"
match auth from any for any action "dkim"

On Sat, Sep 1, 2018 at 1:06 PM Reio Remma wrote:
>
> On 01.09.2018 19:56, Matt Schwartz wrote:
> > Thanks but I finally figured it out and wrote up a little something
> > that could hopefully benefit others. It's nice being able to use the
> > .forward feature.
>
> Wondeful. :)
>
> For multiple domains we have to use something like this for the userbase
> lookup to succeed. :)
>
> table virtuals { r...@turin.mrstuudio.ee = reio_turin.mrstuudio.ee }
> table userinfo { reio_turin.mrstuudio.ee =
> 5000:5000:/home/vmail/turin.mrstuudio.ee/reio }
>
> accept tagged Filtered for domain <domains> virtual <virtuals> userbase
> <userinfo> deliver to lmtp "/var/run/dovecot/lmtp" rcpt-to
>
> It actually doesn't look that complicated with just one user defined. :D
>
> Good luck,
> Reio
>

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org

Reply via email to