The 'non-ascii' subject is probably not literal non-ascii, but rfc2047-encoded non-ascii.
if so, this perl regex will identify anything with rfc2047-encoding. You might want to filter both "Subject:" and "From:" for this.
/=\?.*\?[qbQB]\?.*\?=/
Of course, while the sender isn't supposed to put raw high-ascii in the message headers, that doesn't mean they won't. This regex !should! catch high-ascii, but no guarantees.
/[\200-\377]/
Note that neither are anchored either at the beginning or end of the string. This is deliberate.
Comments 2
if so, this perl regex will identify anything with rfc2047-encoding. You might want to filter both "Subject:" and "From:" for this.
/=\?.*\?[qbQB]\?.*\?=/
Of course, while the sender isn't supposed to put raw high-ascii in the message headers, that doesn't mean they won't. This regex !should! catch high-ascii, but no guarantees.
/[\200-\377]/
Note that neither are anchored either at the beginning or end of the string. This is deliberate.
Hope this helps.
Alex
Reply
Reply
Leave a comment