Fix invalid content-type header
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 the invalid Content-Type header when is missing a MIME subtype.
Test Case Example
MIME-Version: 1.0
Date: Thu, 12 Aug 2021 12:05:10 +0100
Message-ID: CACQqMReZmHMHG1XXWic6WthLBYHe223mth=ndmTNXnec_gt9XA@mail.gmail.com
Subject: Testing Type-Content
From: Vladyslav Zacharko vlad@thepluginpeople.com
To: changeme@thiswontwork.com
Content-Type: multipart/; boundary="0000000000005d46f805c95ab59d"
--0000000000005d46f805c95ab59dContent-Type: text/plain; charset="UTF-8"
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesettingindustry.
Lorem Ipsum has been the industry's standard dummy text eversince the 1500s,
when an unknown printer took a galley of type andscrambled it to make a type specimen book.
It has survived not only fivecenturies, but also the leap into electronic typesetting,
remainingessentially unchanged. It was popularised in the 1960s with the
release ofLetraset sheets containing Lorem Ipsum passages, and more recently
withdesktop publishing software like Aldus PageMaker including versions ofLorem Ipsum.
--
Vladyslav Zacharko
The Plug in People Ltd.
--0000000000005d46f805c95ab59d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>
<h2>What is Lorem Ipsum?</h2>
<p><strong>Lorem Ipsum</strong> is simply dummy text of the printing andtypesetting
industry. Lorem Ipsum has been the industry's standard=20dummy text ever since the 1500s,
when an unknown printer took a galley=20of type and scrambled it to make a
type specimen book. It has survived=20not only five centuries, but also the leap
into electronic typesetting,=20remaining essentially unchanged. It was popularised
in the 1960s with=20the release of Letraset sheets containing Lorem Ipsum passages,
and morerecently with desktop publishing software like Aldus PageMaker=20including
versions of Lorem Ipsum.</p></div>
<div><br></div>-- <br><div dir==3D"ltr" class=3D"gmail_signature"
data-smartmail=3D"gmail_signature"><div =dir=3D"ltr"><div><div dir=3D"ltr"><div>
<div dir=3D"ltr"><div>Vladyslav Zach=arko<br></div><div>The Plug in People Ltd.</div>
<div>
<img src=3D"https://do=http://cs.google.com/uc?export=3Ddownload&id=3D1GyXobViPNfUTuymze-Z37cfBrjrbB0= Js&revid=3D0B7BvsKsyMMv0SzFacStKOFl3NXIvTnBaREU1RkRqR05oQ0tjPQ"><br>
</d=iv></div></div></div></div></div></div></div>
--0000000000005d46f805c95ab59d--
Script example
if (headerBeans.get('content-type')!=null) {
print('originalTo:', headerBeans.get('content-type').getOriginalVal());
if (headerBeans.get('content-type').getOriginalVal().equals('multipart/; boundary="0000000000005d46f805c95ab59d"')) {
headerBeans.get('content-type').setUpdatedVal('multipart/alternative; boundary="0000000000005d46f805c95ab59d"');
}
print('updatedTo:', headerBeans.get('content-type').getUpdatedVal());
}