PHP Classes

Email headers case sensitivity

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Email headers case sensitivity  >  (Un) Subscribe thread alerts  
Subject:Email headers case sensitivity
Summary:Class will for example parse "Cc:", but not "CC:"
Messages:4
Author:Klemen
Date:2014-01-31 11:21:08
Update:2014-02-01 10:03:07
 

  1. Email headers case sensitivity   Reply   Report abuse  
Picture of Klemen Klemen - 2014-01-31 11:21:08
This is a great class that I have been using for year.

One thing I noticed is that some email clients don't generate email headers strictly as RFC 2822 states.

For example RFC 2822 uses "Cc" and "Bcc" headers. However, some email clients create "CC" and "BCC" instead (all upper case).

This of course is not this class fault, but it would be great if mime parser would ignore case when processing headers to accept such small deviations, even if not 100% strict with RFCs.

So that "Cc:", "CC:" and "cc:" would be recognized as "Cc:".

You know the old saying "be liberal when accepting input, be conservative when producing output".

  2. Re: Email headers case sensitivity   Reply   Report abuse  
Picture of Klemen Klemen - 2014-01-31 11:30:20 - In reply to message 1 from Klemen
Just to clarify - I mean when calling

$mime->Analyze

the results for example for "Cc:" don't contain emails if email header was "CC:"

  3. Re: Email headers case sensitivity   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-01-31 19:20:10 - In reply to message 1 from Klemen
There may be some misunderstanding.

The class always treats header names with case insensitivity. I just tried it here again to double check, and I can see the CC: header values in the Analyze function results too.

Did you come across case where those header values do not appear?

  4. Re: Email headers case sensitivity   Reply   Report abuse  
Picture of Klemen Klemen - 2014-02-01 10:03:07 - In reply to message 3 from Manuel Lemos
I don't know what I was doing yesterday, but I just tested it again and it worked just fine.

Sorry for the misunderstanding, I have no idea what went wrong when testing yesterday.

Thank you for providing this and other useful classes!