Wednesday, January 27, 2021

smtpd virtual table with only userparts

For an smtpd.conf containing this:

----------------8<----------------
table domains { mydomain.tld }
table virtuals file:/etc/mail/virtual

action "domain" maildir "/var/vmail/mydomain.tld/%{dest.user}" virtual <virtuals>

match from any for domain <domains> action "domain"
----------------8<----------------

The following virtual file works:

----------------8<----------------
bertalan.peter@mydomain.tld bp99@mydomain.tld
bp99@mydomain.tld vmail
----------------8<----------------

That is, when I send mail to both <bertalan.peter@mydomain.tld> and
<bp99@mydomain.tld>, it is delivered to the
/var/vmail/mydomain.tld/bp99/.

After reading this[1], I tried to remove the domain parts from my
virtual table:

----------------8<----------------
bertalan.peter bp99
bp99 vmail
----------------8<----------------

But this caused email sent to <bertalan.peter@mydomain.tld> be delivered
to a /var/vmail/mydomain.tld/bertalan.peter/.

Is it possible to skip the domain part in a virtual table file?
That way I could also reuse the file with a different domain.


Thank you
Bertalan

[1]: https://undeadly.org/cgi?action=article&sid=20130130081741>,

--
Bertalan Z. Péter <bertalan.peter@bertalanp99.eu>
PGP: FB9B 34FE 3500 3977 92AE 4809 935C 3BEB 44C1 0F89

No comments:

Post a Comment