Monday, February 21, 2022, 5:04:59 AM, Matus UHLAR - fantomas  wrote:

> On 20.02.22 18:49, Phil Biggs wrote:
>>I have virtual_mailbox_maps in use with reject_unlisted_recipent and use
>>virtual_alias_maps to translate a validated address into a single matching
>>address for the corresponding dovecot user.

> virtual_alias_maps map any address (even non-local one) to one or more 
> addresses:
> http://www.postfix.org/ADDRESS_REWRITING_README.html#virtual

> virtual_mailbox_maps map addresses in virtual domains into pathnames where 
> mailboxes are located:
> http://www.postfix.org/virtual.8.html

> so, they have quite different usage.
>> For example:
>>
>>/usr/local/etc/postfix/vmailbox
>>        validu...@example.com whatever
>>
>>/usr/local/etc/postfix/vuser
>>        validu...@example.com dovecotu...@example.com
>>
>>In my case, these two tables will always match on the LHS.
>>
>>Just wondering whether there any reason not to use the virtual_alias table for
>>both purposes?  It would make synchronisation with the dovecot users DB just a
>>little easier.

> you don't need synchronization, and you apparently don't need 
> virtual_alias_maps in this case.

>>virtual_mailbox_maps = hash:/usr/local/etc/postfix/vuser
>>virtual_alias_maps = hash:/usr/local/etc/postfix/vuser
>>
>>(Mail sent directly to dovecotu...@example.com should be rejected.)

> you must take care of this differently.


Thanks for the reply, Matus.

Perhaps I didn't explain this very well.

I read the linked documents many times before doing what I have and the 
current configuration works as I expected: 

- emails sent to (external) validuser@ addresses are validated
  as present in virtual_mailbox_maps 
- validuser@ addresses are translated to (internal) dovecotuser@
  via virtual_alias_maps 
- only dovecotuser@ addresses are accepted by dovecot 
- emails originally addressed to dovecotuser@ addresses are rejected 
  
Perhaps this is not the intended use but it certainly works.

The question was about whether there might be a problem with using the 
same hash table for both virtual_mailbox_maps and virtual_alias_mapps. 
That would mean I only need to update the virtual_alias_maps and the dovecot 
'users' DB, which must be in sync. 

-- 
Cheers,
Phil 

Reply via email to