In the latter, I see that $params needs server_id. What is the appropriate way to get this? Via a MySQL query? Or, because this isn't likely to change, just hard code it?
The server_id of a forward is the same then the one of the mail_domain as the forward has to be created on the same server.