RFE: Don't Modify Postfix Virtual Unless Necessary

As a follow-up to Bug #448, I would like to request that Virtualmin not automatically modify the file /etc/postfix/virtual (or any similar files) in a normal user modify transaction when there are no changes to be made.

Currently, when a user is modified for any reason, such as to increase/decrease their quota, Virtualmin always performs the following four operations:

1) remove their address(es) from the virtual file
2) run postmap to update virtual.db
3) re-add their address(es) back to the bottom of the virtual file
4) finally, run postmap again to update virtual.db

When none of the e-mail addresses have been changed in the modify transaction, these operations are unnecessary. At a minimum, they cause file time stamps to be updated when no changes have been made (which can make troubleshooting confusing and adds to backup and other administration burdens), and they mess up the order of entries in the file (since they are removed from their original position and added onto the end). Worse yet, they have the potential to do real harm in some cases, as seen in Bug #448.

So, I would like to request that Virtualmin bypass modifying any of these files if there are no e-mail changes made when a user is modified. From my basic scanning of the source code, I see line 1026 in virtual-server-lib.pl indicates:

# Take away all virtusers and add new ones

Is this really necessary if nothing has been changed?

Closed (fixed)