Hello,

I have a small system with 2 domains and the domain email uses vhost + 
dovecot and works well. OpenSMTPD is 6.8.0p2 on freebsd-13.1-releng

I also want things like cron deliver email locally to a non-root user. 
So, basically what's needed is for opensmtpd to deliver based on 
whether the destination is either itself or to a vmail domain.

relevant parts of smtpd.conf :

###########
table aliases file:/etc/mail/aliases
table domains file:/etc/mail/domains
table passwd passwd:/etc/mail/passwd
table virtuals file:/etc/mail/virtuals

# action "local" maildir alias <aliases>
action "local" lmtp "/var/run/dovecot/lmtp" rcpt-to virtual <virtuals>

match for local action "local"
match from local for any action "relay"
match from any for domain <domains> action "local"
match from any auth for any action "relay"
############

The problem appears to be with the 'action' part. It will
run with one or the other but not both, in the above config,

If only the first action line is enabled, I get periodic(8) emails normally. If 
it is disabled and the second one is enabled, the following appears in 
/var/log/maillog when periodic(8) runs (but mail for the vmail domains is 
delivered to dovecot):

smtp failed-command command="RCPT TO:<r...@local.machine.name> " result="524 
5.2.4 Mailing list expansion problem: <r...@local.machine.name>"

root's email is meant to go to an ordinary user (therefore: Maildir)

If both are enabled, smtpd won't start, with the error:

% doas service smtpd restart
Performing sanity check on smtpd configuration:
/usr/local/etc/mail/smtpd.conf:27: dispatcher already declared with that name: 
local

How can I fix this? Do I have to make root's email delivered via vmail? I guess 
a more succinct version of the issue is "can OpenSMTPD deliver to both vmail 
and Maildir depending on origin/destination?"

thanks,

Reply via email to