One of our main applications is sending out emails that have encoded subjects with base64 but that application is sending wrong characters at the end. I am looking at Header_checks with subject replace, but cannot understand how to use wildcards etc. to reconstruct the subject. We really need the mail part of this program as we send out about 300 mails to customers a day, but it will take the application developer some time to fix it and we have to test it before we can implement. So a server between the app and our sending mailserver would be a fine temporary solution.
For example this is the original subject:
=?windows-1252?B?VGhpcyBpcyB0aGUgb3JpZ2luYWwgc3ViamVjdA==?=
But it should be:
=?windows-1252?B?VGhpcyBpcyB0aGUgb3JpZ2luYWwgc3ViamVjdA==
The last 2 characters should be cut off. Currently I replace the subject of every mail entirely, but this is not desirable for the long run. I currently use this regex in header_checks
:
/^Subject:.*/ REPLACE Subject: New subject goes here