Fix invalid email address format

Any Headers you wish to alter must be in the Matching Headers csv, or they will not be processed!

This example will show how to fix incorrect To header email address format to match the catch email address.

Test Case Example

MIME-Version: 1.0 Received: by 10.223.112.12 with HTTP; Sat, 18 Jun 2011 22:42:26 -0700 (PDT) Date: Sun, 19 Jun 2011 17:42:26 +1200 Message-ID: <BANLkTinB1mfSh+GwOXGNWoL4SyDvOpdBoQ@mail.gmail.com> Subject: This is a starting email template, update as required From: admin@localhost.com To: changeme <changeme> Content-Type: text/plain; charset=UTF-8 some text

 

Script example

if (headerBeans.get('to')!=null) { print('originalTo:', headerBeans.get('to').getOriginalVal()); if (headerBeans.get('to').getOriginalVal() == "changeme <changeme>") { headerBeans.get('to').setUpdatedVal("changeme <changeme@domain.com>"); } print('updatedTo:', headerBeans.get('to').getUpdatedVal()); }