On Sat, May 14, 2022 at 06:20:57PM +0800, wilson <wil...@4shield.net> wrote:
> After adding alias to: > > virtual_alias_maps > > and run: > > postmap virtual_alias_maps > > postfix can know the alias was added even if there is no postfix reload. > > How does postfix know the alias was added? > > Thanks The way I think of it (which might be wrong), is that when a database type needs postalias/postmap to create a binary file from a text source file, postfix processes access the binary file for each lookup, so when the binary file is updated, postfix processes see the updated information immediately. But when a database type doesn't need a binary version, and postalias/postmap are not used, then postfix processes read the text source file and hang on to the information in it even if it changes on disk. But that only lasts until the processes stop and are replaced with new ones (which doesn't take very long), so a reload still isn't strictly needed unless you really want the updates to take effect immediately. But you might want that, if you want to test the update. The database types that use postalias/postmap to create a binary file are: btree cdb dbm hash lmdb sdbm The database types that are read directly as text are: pcre regexp cidr texthash You didn't specify an explicit database type in the postmap command, so it's probably hash (i.e., the value of the $default_database_type parameter). cheers, raf