Strip HTML on incoming email, new ticket

We receive email submissions from two forms on a drupal server. Something in the drupal form sends a 170-KB comment inside a style block in the HTML header, which makes all of our submissions from those forms say “Message body is not shown because it is too large.” in the web view.

The best solution, fixing the form, is out of my hands.

I think I can edit the incoming message to replace the HTML header with something innocuous (and, more importantly, small) but I don’t know where to do it. Would it be a scrip with a custom condition (the ticket is being created based on email from one of those two forms) and custom action (lib/RT/Action/ appears to have great potential)? But if I go this route, how do I get access to the email message body to edit it for the Content attribute? And if there are multiple attachments to the email, can I include them as well as the text/html one?


Quick fix:

Set($PreferRichText, 0);