E-mail filtering does not seem to honor multiple line subjects

Nathan Ladwig

Registered
May 2, 2019
2
0
1
Denver
cPanel Access Level
DataCenter Provider
Per the RFC at RFC 2822 () section 2.2.3 an e-mail subject header can be broken up into multiple lines, such as:

Subject: This
is a test

If I create a filter that matches 'This is a test' it will not match the following:

----
To: [email protected]
From: [email protected]
Subject: This
is a test

This is a test message.
----

It will however match:

----
To: [email protected]
From: [email protected]
Subject: This is a test

This is a test message.
----


I am seeing this behavior both in the Filter Test and in e-mails delivered using this encoding for the subject.

Replicated on 76.0 (build 18)


Here is another thread I found on StackOverflow/ServerFault regarding this issue:

serverfault.com/questions/932111/invalid-newlines-in-headers-break-exim-filters
 

omidsolo

Member
Apr 29, 2019
17
0
1
US
cPanel Access Level
Website Owner
Email Filters in cPanel has some broken features, this folding header support is also one of them.
Technically it is the easiest thing in programming to implement those filters, but in real world this is not happened!
To fix this, when developer is going to find the search criteria in the source string, he just need to replace CRLF | \r\n with nothing so it's removed and then search in the string!
Many of the broken Email Filter features in cPanel are just a matter of String manipulation!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello @Nathan Ladwig,

Can you open a support ticket so we can take a closer look? You can post the ticket number here and we'll link this thread to it.

Thank you.