You could call the API2 function for adding an email forwarder via our XML API.
Originally Posted by organic
<?cp Email::addforward(email=EMAIL,domain=DOMAIN,fwdopt=FWDOPT,failmsgs=FAILMSGS,pipefwd=PIPEFWD,fwdemail=FWDEMAIL ?>
EMAIL = the portion of the email address (to be forwarded) before @. This parameter should never contain the @ symbol.
DOMAIN = the portion of the email address (to be forwarded) after @. This parameter should never contain the @ symbol
FWDOPT is fwd if forwarding to an email address, fail if you want to display a failure message, pipe if you want to pipe the email to a shell script in that cPanel account.
FAILMSGS is used if you selected to display a delivery failure message. This is the failure message that will be sent to the sender of the email.
PIPEFWD is used if you select to pipe to a shell script. This is a path to the shell script on the cPanel account that owns this email address.
FWDEMAIL is used if you select to forward to another email address. This is the full email address messages should be forwarded to.
For documentation on calling this from the XML API, visit: http://twiki.cpanel.net/twiki/bin/vi...ngAPIFunctions
If you prefer to use a pre-assembled PHP 5 class, check out Matt's code at: http://forums.cpanel.net/showthread.php?t=111897