The OpenBSD Journal published such innovative rules:
https://undeadly.org/cgi?action=article&sid=20130130081741
> accept for domain <domains> virtual <users> deliver to maildir
> accept for domain <mytbl> alias <mytbl> deliver to mbox
> accept for domain { poolp.org, opensmtpd.org } virtual { root =>
gilles } […]
> accept for domain <myldaptable> alias <myldaptable> deliver to […]
Published twelve years ago, the terms are now called differently (accept
=> match; deliver => action), so the rule I need would look like this:
> match for domain <domains> alias <aliases> action "cyrus"
Unfortunately, 'smtpd -n' says “syntax error” on that line.
Replacing this rule with the following:
> match for rcpt-to <aliases> action "cyrus"
“Configuration OK”, but now mda only discards mail for unlisted alias,
does not expand to the right recipients. No action adjustments help:
> action "cyrus" lmtp "/var/cyrus/socket/lmtp"
> action "cyrus" lmtp "/var/cyrus/socket/lmtp" virtual <virtuals>
> action "cyrus" lmtp "/var/cyrus/socket/lmtp" rcpt-to virtual <virtuals>
As experienced postmasters you probably know, is not there really some
way to expand aliases before submitting them to LMTP? Can both alias and
virtual work together, as they do in Sendmail? Virtuals are designed for
virtual domains, and aliases have some advantages to deliver mail to a
file, :include: a distribution list, start a program, etc.
--
Vladas Palubinskas
vla...@palubinskas.lt
https://vladas.palubinskas.lt/