Clean forwarders to delete empty forwarder during email removal

Version 1.55

Bugfix
Finished

Relating to this feature: https://www.directadmin.com/features.php?id=1398 where it gives you the option to "Clean Forwarders" when deleting an email account to ensure it does not forward to a non-existent address, Scenario: E-Mail accounts: foo@domain.com bar@domain.com forwarder: foo@domain.com -> bar@domain.com when the E-Mail address bar@domain.com is removed, with the "Clean Forwarders" option enabled, DirectAdmin would have removed forwarder bar@domain.com from foo@domain. Once removed, there would be 0 destination, and DirectAdmin would have set it to :fail: The premise was "correct" should there not have been a foo@ email account, which was not considered. Fix is to fully remove the alias if there are 0 recipients, rather than setting it to :fail: If a forwarder is removed, the result will no longer redirect to the email listing, but instead show a result page/message notifying that the zero-recipient forwarder has been removed. For cases without the foo@ email, this would still have the same behavior, assuming your catch-all is still set to :fail:.

Interested to try DirectAdmin? Get a 30-day Free Trial!