Insert a new SMTP addresses into an existing Header
Any Headers you wish to alter must be in the Matching Headers csv, or they will not be processed!
This example will alter the existing To address header, and will insert a new recipient into the To header:
Example: Adding a Delivered-To header if one is not present
Script
if(headerBeans.get("Delivered-To") == null) {
var hdr = jemhUtils.addPreProcHeader("Delivered-To", "yourmailbox@blah.com");
headerBeans.put("Delivered-To", hdr);
print("created default Delivered-To: header : "+hdr.getUpdatedVal());
}
Config screenshot:
Inbound Mail Processing output, showing injected value