Just want to warn you that the behaviour of
Mail::addforwarder
is not always what you expect
If you try to add a forwarder with an emailadress not containing @, the forwarder is set to :fail: and all other forwarders for that domain are deleted!
OK, you should check your input, but to delete all forwarders if there is no @ in fwdemail seems a bit hard
ex:
xmlapi->api2_query("testaccount", "Email", "addforward", array(domain=>'test.com',email=>'test',fwdemail=>'toadress.com',fwdopt=>'fwd') );
That call will
* return nothing
* set
test@test.com to :fail:
* delete all other forwarders for test.com
So check your fwdemail before using this
I did this on purpose to test result codes from the API when using IDN-domains with errors, but was not expecting this behaviour ..
// kjg