I have added a sample channel for testing to my answer. Note: The preprocessing script executes before the source message is originally written to the database. This means that resubmitting a message will not execute the preprocess script. Only new messages picked up by the channel will execute the preprocess script. You can manually edit the source of the failed message, and then resubmit the message.