The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

after upgrading to the latest stable, html mails only receive as base64 text

Discussion in 'E-mail Discussions' started by WinterRG, Aug 14, 2005.

  1. WinterRG

    WinterRG Member

    Joined:
    Oct 21, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Anybody seen anything similar, after upgrading to the latest stable WHM/cPanel we seem to be seeing a slight problem. I cannot work out if it is SpamAssiassin, ClamAV or PHP itself,

    We have a client that has been sending out HTML Only emails based on a form being filled in and using php mail function, all has been well, but after we updated the server he now complains of his users only seeing the emails as text, but even mor eundesirable, the text is actually the HTML markup tags <ooooops> We have noticed that something , somwwhere is adding a header of "text/plain" after his initial html/text header.


    Return-path: <nobody@XXXXXXXXXXX.org>
    Envelope-to: XXXXXXXX@XXXXXXXXXX.com.au
    Delivery-date: Sun, 14 Aug 2005 20:56:49 +1000
    Received: from [XXX.XXX.XXX.XXX] (helo=XXXXXXXXX.org)
    by XXXXXXXXXXXXXXXX with esmtps (TLSv1:AES256-SHA:256)
    (Exim 4.51)
    id 1E4GAW-0008BA-HD
    for XXXXXXXX@XXXXXXXX.com.au; Sun, 14 Aug 2005 20:56:45 +1000
    Received: from nobody by XXXXXXXXXXXXXX.org with local (Exim 4.50)
    id 1E4GAR-00080Q-78; Sun, 14 Aug 2005 20:56:39 +1000
    To: XXXXXXXXX@XXXXXXXXXXXXXX.com.au
    Subject: SMC : YYYYYYYYYYYYYYYYYYYYYYYY
    MIME-Version: 1.0
    Content-Type: text/html; charset=ISO-8859-1
    From: XXXXXXXXXXXX <XXXX@XXXXXXXXX.com.au>
    Reply-To: XXXXXXXX@XXXXXXXX.com.au
    cc: XXXXXXXXX@XXXXXXXX.com.au
    THE CULPRIT
    Mime-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: BASE64

    Message-Id: <E1E4GAR-00080Q-78@XXXXXXXXXXXXX.org>
    Date: Sun, 14 Aug 2005 20:56:39 +1000
    X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
    X-AntiAbuse: Primary Hostname - XXXXXXXXXXXXXX.org
    X-AntiAbuse: Original Domain - XXXXXXXXXXXXXXX.com.au
    X-AntiAbuse: Originator/Caller UID/GID - [99 501] / [47 12]
    X-AntiAbuse: Sender Address Domain - XXXXXXXXXXXXX.org
    X-Source:
    X-Source-Args: /usr/local/apache/bin/httpd -DSSL
    X-Source-Dir: XXXXXXXXXXX.com.au:/public_html/XXXXX/XXXXX/XXXXXX
    X-MailCheck-MailScanner-Information: Please contact the ISP for more information
    X-MailCheck-MailScanner: Found to be clean
    X-MailCheck-MailScanner-SpamCheck: not spam, SpamAssassin (score=3.042,
    required 5, HEADER_COUNT_CTYPE 1.68, HTML_MESSAGE 0.00,
    MIME_HTML_ONLY 1.16, UPPERCASE_25_50 0.21)
    X-MailCheck-MailScanner-SpamScore: sss
    X-MailScanner-From: nobody@XXXXXXXXXXXXX.org


    Thanks in advance for any ideas

    Russ
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Setting the content-type in the email header is the responsibility of the MUA, in this case the php script, so they user needs to get a fix into the php script so that in the mail() command they set the content-type field to text/html:

    PHP:
    // To send HTML mail, the Content-type header must be set
    $headers  'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

    // Mail it
    mail($to$subject$message$headers);
     
  3. WinterRG

    WinterRG Member

    Joined:
    Oct 21, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for taking a look, in this particular case, this is what has me stumped, the user does have a Content Type in his script and it was working fine prior to updating cPanel/WHM, the script mail headers were not modified at this time, only the addition of three more fields in the original form, unless the size of the variables being posted through $_POST have exceed some sort of limit <shrug>


    $to = ''.$psEmail.'' . ', ';
    $to .= ''.$ssEmail.'';
    $subject = "".$appShortName." : Transition Notification";

    $message = ("

    <html>
    <head>
    <title>".$appShortName." : Transition Notification</title>

    etc.. etc.. etc ..



    ");

    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: ".$appName."<".$psEmail.">\r\n";
    $headers .= "Reply-To: ".$psEmail."\r\n";

    mail($to, $subject, $message, $headers);
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That's odd. You might want to try making sure you have the latest exim for your release:

    /scripts/updatenow
    /scripts/eximup


    Though I don't see how that would cause the problem. It might be an idea to write a short test php script to send html emails that you can easily play with to find out where the problem might be.

    You could also search the mail log for that email to see if any errors were issued:

    grep E1E4GAR-00080Q-78 /var/log/exim_mainlog

    Lastly, just incase, it would be a good idea to make sure that you are using the latest MailScanner. If you are, then you could disable all scanning for that domain to ensure that MailScanner isn't somehow rewriting the header.
     
  5. WinterRG

    WinterRG Member

    Joined:
    Oct 21, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for you efforts on this, it is a bit of a curly one.... :rolleyes: still playing, just rebuilt apache and recompiled PHP with no effect, found nothing in the exim logs, so I think I must be down to stopping the MailScanner and see if it is rewriting the header for some reason <shrug> very weird, will let you know as i progress (or not as the case may be! <teeheehehe>)
     
  6. WinterRG

    WinterRG Member

    Joined:
    Oct 21, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Well, I ggota admit, this one has got me stuffed.... tried allsorts, even rubbing sacred bones over the keyboard and not a blind bit of difference. Disabled SpamAssassin & clamAV, forced an exim re-install, did the update, stood on my head and whistled out of an un-mentioneable place <grin> tinkered with different Headers, ContentTypes content TransferTypes and all that did was encode the text version of the HTML then and still something is inserting the additional Base64 plain/text after the html header. <shaking head> I think it might be time to go to bed. Will continue researching and tinkering tomorrow afternoon.
     
  7. WinterRG

    WinterRG Member

    Joined:
    Oct 21, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    It get weird'er I collected mail in ThnderBird and it appears to work there, just not in outlook any longer :confused: :eek:
     
  8. WinterRG

    WinterRG Member

    Joined:
    Oct 21, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    ok, so I didn't go to bed...... I moved the whole customer application to another similar server, same setup, same apps, configured as near as dammit the same and its works just fine, no issues at all <shrug> this has really got me stuffed now.....!!!!

    And all this after a upcp, and both these servers were actually done within 4 hours of each other, so it might seem that maybe one has some form of corruption somewhere, but I cannot see it or find it.
     
  9. WinterRG

    WinterRG Member

    Joined:
    Oct 21, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    GOT THE LITTLE B*%&er....... somehow during the update the php.ini must have got damaged or something in the php update didn't like the "mbstring.func_overload = 7" param and messed up the ISO character set turning it to UTF8 (UniCode) for international language sets <shrug> will have to look in to it a bit further because we do actually need Unicode turned on for one application on this server, but for now, it will do quite nicely.

    Thanks for your time, thought and efforts, very much appreciated from "Down UndeR" at some un-godly hour of the morning
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Well done for tracking that down - I wouldn't have aeven thought of checking php.ini in relation to that problem.
     
Loading...

Share This Page