virtual_alias_maps - last file of any type is used for updating - first hash file should be used instead

An entry such as:

virtual_alias_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp

does not work as intended. When new aliases are added via Virtualmin, they are added to the file /etc/postfix/virtual-regexp, the last file in the list. The above order is the preferred order since most aliases will come from the hash:/etc/postfix/virtual file.

The current workaround is to have:

virtual_alias_maps = regexp:/etc/postfix/virtual-regexp, hash:/etc/postfix/virtual

It seems reasonable that the above directive should be parsed to identify the hash file and have Virtualmin add new aliases to that file (and then to do a postmap on that file). If there are multiple hash files, then I'd recommend picking the first hash file on the assumption that 2nd, 3rd, etc. files represent alias mappings that are relatively rare.

Status: 
Closed (fixed)

Comments

Thanks, that's a good suggestion .. I will have Virtualmin prefer hash maps over regexps where possible in the next release of Webmin. But for now, re-ordering is the best work-around.

Automatically closed -- issue fixed for 2 weeks with no activity.