Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here you can see the example mail processing report generated by JEMHC for this Test Case. A user would have been associated if it didn’t exist, in this case we’ve simply created a new portal user with the correct email address and name.

...

Removing Recipients if Combined Addresses Exceed 255 Characters:

If you are using the default email only user custom fields, you may hit the 255 character limit. Which can prevent comments/issues being created. One way around this is to use pre-processing script to remove all recipients if larger than 255 characters.

Example Script:

Code Block
#set ($toCc = "")
#if ($taskUtils.getHeader($message, 'To') != $null) ##Checks if there is a To header, before adding the value to $toCc
    #set($toCc = $toCc + $taskUtils.getHeader($message, 'To'))
#end
#if ($taskUtils.getHeader($message, 'Cc') != $null) ##Checks if there is a Cc header, before adding the value to $toCc
    #set($toCc = $toCc + $taskUtils.getHeader($message, 'Cc'))
#end
#if ($stringUtils.length($toCc)>=255) ##checks character length, if larger than 255 characters then the headers will be removed and replaced.
    #if ($taskUtils.getHeader($message, 'To') != $null)
      $message.removeHeader("To")
    #end
    #if ($taskUtils.getHeader($message, 'Cc') != $null)
      $message.removeHeader("Cc")
    #end
    $message.setHeader("To","test@test.com") ## Sets the To header with a Catch Email Address, to ensure the email will be processed.
#end

Example Test Case:

Code Block
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
Subject: CHANGE_SUBJECT!!! SCRUM-3
From: euan@thepluginpeople.com
To: test@test.com, ughsghsdfbjnsjn4upiwncewbgerhgf@gmail.com, jrgiojsdgiojsdgnmwkjbnqjkbsduisdnfwehuiwonfksdmklfm@gmail.com, hgsiuhgkfnsgkrjnguhtnvfmdlkaiunjfgndsvjipeuipnvui@gmail.com, hgtgrnemgkfehgishdnafjklqgnuihgu4pqnfuipngkrjan4tuingufdahfjkenqgfrlpsjfiaqphgwpnug@hotmail.com iregnfsadjlfgbreiupgbnjerkgnfjsgbwqpf4ufnrbvjfnblvjdsfbgjsgbnsfdlbgjfnlsvjkanvrjk@gmail.com
CC: gmail@gmail.com
Content-Type: text/plain; charset=UTF-8

CHANGE BODY!!!

Test Script:

Code Block
$assert.assertEquals('test@test.com', $taskUtils.getHeader($message, 'To').getValueAsCSV())

Script Configuration:

...