changing server contact address does not update mail aliases

servers are created with hostmaster, postmaster, webmaster and abuse aliases pointing to the server admin at-time-of-creation.

if you edit the virtual server to set a new contact address, then the code should do this:

if servertemplate has mail aliases, loop through them
  if template.mailaliasdestination == "${EMAILTO}"
    look for that alias on the server (and on all sub-servers/alias servers) and update them to point to the new contact address

this is a simple fix but very important.

also on the same subject: if you go into "edit mail aliases" on a server (doesn't matter if it's the main server or a sub-server), and change an alias such as "hostmaster" to point to something else, then it should look to see if this is a template-based alias, and if so should replicate the change to all other parent/child servers in the whole hierarchy for that user. alright, this latter idea doesn't suit everyone at all times, so more thought would have to go into how it could be implemented without messing with the ability to do per-domain customization. but anyway, something like this would prevent getting the default/important records desynced between related domains.

both of these suggestions will of course overwrite any custom values, and may therefore fall under "the lesser of two evils" but i definitely say that updating "${EMAILTO}"-based records on contact address change is an important, useful feature which will be the desired behavior for almost 100% of usage cases. only do it for "${EMAILTO}"-derived records, though.

Status: 
Closed (fixed)

Comments

Changing all aliases that point to the old admin address could be a bit presumptuous, because the admin might want email to the postmaster to go to the old address still (assuming it is still valid).

i am well aware of the danger of overwriting custom values and mentioned as much in the initial post.

so, implement it as follows:

imagine that the old contact address was "foo" and the new one is "guy@bar.com" (no relation to gay@bar.com, that is his brother)

when changing the contact address of the main virtual server:

loop through all template.mailaliases (such as hostmaster, postmaster, whatever)
  if template.mailalias.destination == "${EMAILTO}" (this is a template alias set to derive from the owner)
    loop through mail aliases for the main server and all sub-servers and alias-servers (i.e.: everything!)
      if server.mailalias.name == template.mailalias.name (if this server still has that template-derived alias)
        if server.mailalias.value == "foo" (if this server still has the old, default value for that mail alias)
          server.mailalias.value = "guy@bar.com"

voila.

That makes sense .. I'll make this change in the next release.

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