On Wed, Jan 12, 2022 at 11:09:02AM +1100, Phil Biggs <mb170...@pjb.cc> wrote:

> Hello all,
> 
> I have a lot of email addresses of the form mbYYMMDD@ (just like the one I'm 
> sending from here).  They're unique to a specific site/purpose and have 
> accumulated over nearly 20 years.
> 
> My current windows-based MSA allows the MUA user "ml-postfix-users" to login 
> and receive emails using the above email address. I'm only using POP3/SMTP 
> and 
> outbound is all from the MSA via postfix. 
> 
> To ease migration from the Windows server to Dovecot I would like to be able 
> to 
> keep the MUA using the existing user names, rather than manually editing 
> every 
> MUA account manually.
> 
> I can't figure out how to do this username-emailaddress mapping with Dovecot, 
> so I'm looking at using virtual in postfix.  Here's what I have so far.
> 
> main.cf includes:
> 
> # Route inbound for valid recipients to dovecot
> virtual_transport = lmtp:unix:/var/spool/postfix/private/dovecot-lmtp
> virtual_mailbox_domains = pjb.cc
> virtual_mailbox_maps = hash:/usr/local/etc/postfix/vmailbox
> virtual_alias_maps = hash:/usr/local/etc/postfix/virtual
> lmtp_use_tls = no
> 
> vmailbox contains:
> mb170...@pjb.cc ml-postfix-users
> # +LOTS of others
> 
> virtual contains:
> @pjb.cc all
> 
> The Dovecot users file includes:
> ml-postfix-us...@pjb.cc:,<passwordstuff>:10043:10000:
> 
> 
> Hoping someone here can tell me whether I'm on the right track with the above 
> or (perhaps more likely) that I'm going about this in entirely the wrong way. 
> 
> -- 
> Thanks,
> Phil

Hi,

It looks good. I have a vaguely similar setup with
hundreds of addresses, but it is slightly different. I
don't use Dovecot as an lmtp server. I get Postfix to
directly write the email to Docevot's mailbox
directories. But that does seem uglier than using lmtp.
Maybe I should change it, but I like not having to rely
on Dovecot for delivery, just in case it's not running
for any reason.

The other main difference is that I have the large
number of address in /etc/postfix/virtual pointing to a
small number of entries in
/etc/postfix/virtual_mailbox_maps. So the addresses go
in virtual, and the accounts go in vmailbox. That seems
to me to be a more logical place for the addresses
themselves, but it's probably immaterial in practice.

cheers,
raf

Reply via email to