EXIM custom filter to block email address in name field?

NetVicious

Member
Feb 4, 2013
17
0
51
cPanel Access Level
Reseller Owner
I'm testing at this moment this exim filter:

if $h_from matches "\"[^\"]*@[^\"]*\".*<(.*)>.*"
then
headers add "Old-Subject: $h_subject"
headers remove "Subject"
headers add "Subject: [False name] $h_old-subject (real email is $1)"
headers remove "Old-Subject"
endif


I'm getting a bad encoded new subject, when the real subject has non-US symbols. Someone knows how to fix this?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,667
1,853
363
cPanel Access Level
Root Administrator
Hey there! I'm not sure there is much that can be done from the cPanel side about this issue, since this sounds like an encoding issue with Exim itself.

In their documentation under section 5 at 3. Exim filter files they state the following:

"Leading and trailing white space is removed from header line data, and if there are any MIME “words” that are encoded as defined by RFC 2047 (because they contain non-ASCII characters), they are decoded and translated, if possible, to a local character set. Translation is attempted only on operating systems that have the iconv() function. This makes the header line look the same as it would when displayed by an MUA. The default character set is ISO-8859-1, but this can be changed by means of the headers command (see below).

If you want to see the actual characters that make up a header line, you can specify $rheader_ instead of $header_. This inserts the “raw” header line, unmodified."

so you may need to work with those different header values to see if that will allow you to process the non-English characters normally.

Section 6 here talks about the "add" and "remove" options on the filters:


If that isn't enough information to resolve the issue, posting to the Exim users list may be the best option, or another user may see this thread and share their experience.