Thanks for the follow-up.

I was planning on eventually switching to dovecot for delivery. Thank you for figuring out that part!


-Andy


On 4/7/2020 11:01 AM, Leo Unglaub wrote:
Hey,
thank you soooo much for that snippet. I think i finally understood it and it works now. I had to addapt your config a little bit but it works now. I use basically your config with the action changed to the following:

action "local-lmtp" lmtp "/var/dovecot/lmtp" rcpt-to virtual <vmailstub>

At first i give it a try without the rcpt-to option to lmtp, but without that Dovecot always rejected the email for the user "vmail". But now with the rcpt-to it works perfectly.

Thank you all so much for the help and greetings from Vienna
Leo


Am 07.04.2020 um 01:36 schrieb Andrew Swartz:
This is one possible configuration which should do that which I think you are describing:

-------------------------------------------------------------------------

table vdomains file:/etc/mail/table_vmail_domains
table vaddr file:/etc/mail/table_vmail_addresses
table vmailstub   { '@' = vmail }

action "deliver_vmail" maildir "/home/vmail/domains/%{rcpt.domain:lowercase}/%{rcpt.user:lowercase|strip}" virtual <vmailstub>

match from any for domain <vdomains> rcpt-to <vaddr> action "deliver_vmail"

-------------------------------------------------------------------------

This setup accepts mail ONLY for virtual accounts and delivers it to a typical "vpopmail" maildir structure: "/home/vmail/domain/name"

You must create a system user "vmail" which does not receive any mail but is just the home folder for the mailboxes and the user for permission to deliver the mail.

Automate making the domains file with a script which extracts the unique domains from the addresses file.  The redundancy here is due to the smtpd.conf requirements (i.e. not because I think it's cool to have both domain and email address files).

If it's not clear, I can elaborate on how it works.


Reply via email to