The MU forums have moved to WordPress.org

problem with the emails sent from wpmu (17 posts)

  1. Ovidiu
    Member
    Posted 13 years ago #

    I just found that amavisd-new is quarantining almost all the activation and registration emails sent from wpmu usong PHPMailer with the following reason:

    X-Amavis-Alert: BAD HEADER SECTION Duplicate header field: "MIME-Version"

    and indeed the mail contains:

    X-Priority: 3
    X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.2]
    MIME-Version: 1.0
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/plain; charset="UTF-8"
    
    To activate your user, please click the following link:
    so the MIME version is declared twice. How to fix this? is it a Phpmailer bug or rather something that needs to be fixed within wpmu?

  2. cafespain
    Member
    Posted 13 years ago #

    The MIME header is only explicitly set by WPMU in a few places. The activation emails being one of them.

    If you want the quick and nasty way to remove them you need to edit wpmu-functions.php

    lines: 1129, 1148, 1546, 1587

    Just get rid of the "MIME-Version: 1.0\n" part.

  3. Ovidiu
    Member
    Posted 13 years ago #

    ok, thx. went for the quick fix, but what else can you tell me about this? Why are two Mime headers generated?

    Where shall I report this? Is it a wpmu fault or rather a Phpmailer one?

  4. Ovidiu
    Member
    Posted 13 years ago #

    UPDATE:

    now my normal wordpress notifications with regards to comments beeing held for moderation also show the same symptoms :-( duplicate mime headers...

    so it seems its not wpmu specific and google doesn't yield much information ;-(

  5. cafespain
    Member
    Posted 13 years ago #

    Strange one, I've never had a problem with any of the other emails (other than the registration/activation ones), so I just removed that funtionality completely.

    A search of the phpmailer class shows that it only explicitly adds the MIME header in one location, so I doubt if that is causing the duplicate.

  6. Ovidiu
    Member
    Posted 13 years ago #

    google doesn't yield anything, have been searching for a while now. I recently moved several wordpress sites and one wpmu site onto a new server, so it might be related to some different module? might be Phpmailer or whatever :-(

    any other hints? all wordpress sites now send empty emails, no cotnent no subject and with duplicate mime headers...

    see example:

    RFC822 Message body
    Return-Path: <webXXX@XXX.stratoserver.net>
    Received: from localhost (localhost [127.0.0.1])
    by XXX.stratoserver.net (Postfix) with ESMTP id 8AD622E6022C
    for <XXX>; Wed, 20 May 2009 12:37:17 +0200 (CEST)
    X-Quarantine-ID: <z+k++E-XyFc0>
    X-Virus-Scanned: Debian amavisd-new at XXX.stratoserver.net
    X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
    Received: from XXX.stratoserver.net ([127.0.0.1])
    by localhost (XXX.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id z+k++E-XyFc0 for <XXX>;
    Wed, 20 May 2009 12:37:16 +0200 (CEST)
    Received: by XXX.stratoserver.net (Postfix, from userid 5007)
    id 6A4FF2E60177; Wed, 20 May 2009 12:37:16 +0200 (CEST)
    To: XXX
    Subject:
    Date: Wed, 20 May 2009 12:37:16 +0200
    From: "XXX" <XXX>
    Message-ID: <62a29f951dc3f6368fd47cc2d47c99bb@XXX>
    X-Priority: 3
    X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.2]
    MIME-Version: 1.0
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/html; charset="UTF-8"

    btw for the sake of privacy I edited these details but where ever you now see XXX there was valid data.

  7. tdjcbe
    Member
    Posted 13 years ago #

    You know, I looked at this last night myself and it left me scratching my header. The reason being if you look at the line in wpmu-functions.php that generates the headers, you see this:

    $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";

    That's no where near the order of the completed header up there.

    A quick looksee at the IForgetTheName-phpmailer.php file shows where MIME-Version is built so I wondered about marking that out as well because it does looks like it may be a dupe.

    But there's nothing in google about this either as noted up above. You would have thought someone would have had this before.

    And I don;t see it on my client installs or on the testbed.

    It's weird.

  8. Ovidiu
    Member
    Posted 13 years ago #

    the above mail without subject or content is from a wordpress 2.7.1 install.

    The wpmu emails do have subject and content but still suffer from the duplicate Mime header .-(

  9. tdjcbe
    Member
    Posted 13 years ago #

    I just noticed something. It's not using the message headers from the wpmu-functions.php file.

    From the wpmu-functions.php file:

    Content-Type: text/plain;

    From the header:

    Content-Type: text/html;

    YOu know what you could do is change mime-version line within the whatever-phpmailer.php file from 1.0 to something like 1.0a and just see what kicks out. If both lines get edited, you know it;s being passed through that function twice. If it only gets changed once or not at all, it;s coming from somewhere else.

    I don;t think it's using the information that is being set from that $message_headers line up there.

  10. Ovidiu
    Member
    Posted 13 years ago #

    will try that during the weekend, didn't get around to test last night.
    btw here is how the new user registered emails sent from standard wordpress look like now :-(

    RFC822 Message body
    Return-Path: <XXX.stratoserver.net>
    Received: from localhost (localhost [127.0.0.1])
    by XXX.stratoserver.net (Postfix) with ESMTP id 485FC2E60175
    for <XXX>; Thu, 21 May 2009 08:11:48 +0200 (CEST)
    X-Virus-Scanned: Debian amavisd-new at XXX.stratoserver.net
    Received: from XXX.stratoserver.net ([127.0.0.1])
    by localhost (XXX.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id DwDmPZNR7auS for <XXX>;
    Thu, 21 May 2009 08:11:47 +0200 (CEST)
    Received: by XXX.stratoserver.net (Postfix, from userid 5007)
    id 3C5452E60179; Thu, 21 May 2009 08:11:46 +0200 (CEST)
    To: XXX
    Subject: [XXX] New User Registration
    Date: Thu, 21 May 2009 08:11:46 +0200
    From: "XXX" <XXX>
    Message-ID: <cea8e4737ebb33128bebcb5ccacff522@XXX>
    X-Priority: 3
    X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.2]
    MIME-Version: 1.0
    Content-Transfer-Encoding: 8bit
    Content-Type: text/plain; charset="UTF-8"
    
    New user registration on your blog XXX:
    
    Username:
    
    E-mail:
  11. tdjcbe
    Member
    Posted 13 years ago #

    If it works fine for regular wp on your server but not on wpmu, I'd go ahead and raise a trac ticket then. Considering folks have previously had problems with sending email and *cough* you're the first to actually look at an error log while having this problem, it may be a good chance to finally track this one down.

  12. Ovidiu
    Member
    Posted 13 years ago #

    ok, some more questions, seems related to me:

    - seems like phpMail is sending through the local installed mta, using sendmail format right? me running postfix that means it could be me causing this trouble by a misconfiguration of postfix, right?

    - on my wordpress installs not the wpmu, whenever I open a table with phpmyadmin I get these warnings:

    PRIMARY and INDEX keys should not both be set for column "XXX"
    More than one INDEX key was created for column "XXX"
    More than one FULLTEXT key was created for column "XXX"

    XXX depending on which table I open...

    and sorry to clog the wpmu forum with a wordpress matter right now :-( but after I'll fix this, I'll get back to fix the wpmu issue...

    Ok, the wordpress mystery is halfway solved, my DB is messed up, just compared to a fresh install, there are multiple indexes and more problems, will have to revert to a backup. NOW lets check out the wpmu issues!

  13. Ovidiu
    Member
    Posted 13 years ago #

    @tdjcbe:

    now that that wordpress prob. is out of my way, here is some more info about the wpmu prob.

    When registering a new blog, the first mail the new user gets with the link to activate his blog, is perfectly fine.

    X-Priority: 3
    X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.2]
    MIME-Version: 1.0
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    then after activation the newly registered user gets the welcome mail containing his password:

    X-Priority: 3
    X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.2]
    MIME-Version: 1.0
    MIME-Version: 1.0
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    which has the duplicate mime header.
    Also this email is sent twice :-( and the sender looks different, so ti seems to me these two emails are generated in different places.

    can you give me some hints which one comes from where? Meanwhile I'll go digging myself.

  14. Ovidiu
    Member
    Posted 13 years ago #

    commented out all occurances of MIME from wpmu-functions.php, all 4 of them and now everything is great. Mails are getting sent only once, the MIME header is no longer duplicate :-)

  15. andrea_r
    Moderator
    Posted 13 years ago #

    Can you file a trac ticket?

  16. Ovidiu
    Member
    Posted 13 years ago #

    not sure if I should.
    seems I am the only one with this problem?
    can you test it?
    sign up for one of your blogs (wpmu 2.7.1) and check the headers of the mail that contains your password. the first one with the activation link doesn't have the duplicate header problem.

  17. smajda
    Member
    Posted 12 years ago #

    You're not alone, btw: happening to me too. I only caught it because an upgraded email spam filter on our site started flagging it.

    I went ahead and filed a trac ticket.

    I think this is just something a lot of people don't care about: the Subscribe to Comments plugin does this too: I just checked & every "New comment on" notification I've ever received from this plugin (including wordpress.com blogs) includes duplicate MIME headers.

About this Topic