The function to override is emailErrorCheck. It is automatically called by Zimbra just before email is sent(after Send button is clicked). And waits to see if the function returns
"null" - in case of no-issues or
"{hasError:true, errorMsg:"your email has so and so issue", zimletName:"com_zimbra_checkEmail"}" - in case of any issue.
If there is any issue, Zimbra then shows a dialog:
"your email has so and so issue", do you wish to continue?
[Yes] [No]
Code:
com_zimbra_checkEmail.prototype.emailErrorCheck =
function(mail, boolAndErrorMsgArray) {
var bodyText = mail.getBodyContents();
<check email for errors or something>
if(hasError) {
return boolAndErrorMsgArray.push({hasError:true, errorMsg:"your email has so and so issue", zimletName:"com_zimbra_checkEmail"});
} else {
return null;//no errors
}
} I am in the process of documenting all these things @ wiki.zimbra.com