SMTP, Mime Mail, Simple news and Images

graper - December 10, 2008 - 21:53
Project:SMTP Authentication Support
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed
Description

OK I screwed up the first time and i guess nothing got posted.

I have Simplenews, mime mail, smtp, and simplenews template modules installed. Seems that If I place in image into a newsletter and send it, it does not come out as HTML. Without the image and things seem fine. Here is a copy of the information being sent.

This is a multi-part message in MIME format.

--e94c68ef4bbaba48a37c537e455ea38a
Content-Type: multipart/alternative;
    boundary="3430a4f76e5d0c81ca9e590463b00c39"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit


--3430a4f76e5d0c81ca9e590463b00c39
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

    The xxxxxxx Newsletter: In Store Sampling Little Penguin Shiraz   



    
IN STORE SAMPLING LITTLE PENGUIN SHIRAZ
============================================================


This week we will be sampling Little Penguin Shiraz. Stop by The xxxxxxx for a free taste of this Australian Shiraz. 

Learn more about this wine at http://www.thelittlepenguin.com/wines/shiraz
[1]Be sure to remember that Wednesday is Wine Day, 10% off any quantity of
wine.  Today's a great day to buy something new.    



   -- Footer will be appended here
[1] http://www.thelittlepenguin.com/wines/shiraz
--3430a4f76e5d0c81ca9e5904...
text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: base64

[encoded information removed for space]

--3430a4f76e5d0c81ca9e590463b00c39--

--e94c68ef4bbaba48a37c537e455ea38a
Content-ID: <0ecad1a8c91b4e055e986687b1fc5ef8@www.customer.com>
Content-Type: image/jpeg; name="littlepenguinshiraz.jpg"
Content-Disposition: related; filename="littlepenguinshiraz.jpg"
Content-Transfer-Encoding: base64

[encoded information removed for space

--e94c68ef4bbaba48a37c537e455ea38a--

here is the full header for this message

Microsoft Mail Internet Headers Version 2.0
Received: from psmtp.com ([64.18.2.182]) by domainname.com with Microsoft SMTPSVC(6.0.3790.3959);
Wed, 10 Dec 2008 14:07:40 -0600
Received: from source ([192.168.1.5]) (using TLSv1) by postini.com ([64.18.6.14]) with SMTP;
Wed, 10 Dec 2008 14:11:53 CST
Received: from mail.domainname.com ([192.168.1.5] helo=www.customer.com)
by mail.domainname.com with esmtpa (Exim 4.69)
(envelope-from <XXXXX@customer.com>)
id 1LAVPP-0000rj-1r
for xxxxx@domainname.com; Wed, 10 Dec 2008 14:11:47 -0600
Date: Wed, 10 Dec 2008 14:11:46 -0600
To: xxxxx@domainname.com
From: "Customer Name" <XXXXX@customer.com>
Reply-to: XXXXX@customer.com
Subject: [Customer Newsletter] Newsletter Title
Message-ID: <b45c4448bf905a9a27e026031b677948@www.customer.com>
X-Priority: 3
X-Mailer: PHPMailer [version 1.73]
Errors-To: XXXXX@customer.com
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - mail.domainname.com
X-AntiAbuse: Original Domain - domainname.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - customer.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-pstn-neptune: 0/0/0.00/0
X-pstn-levels:     (S:20.68903/99.90000 CV:99.9000 P:95.9108 )
X-pstn-settings: 1 (0.1500:0.1500) cv gt3 gt2 gt1 p
X-pstn-addresses: from <XXXXX@customer.com> [101/5]
Return-Path: xxxxxx@customer.com
X-OriginalArrivalTime: 10 Dec 2008 20:07:41.0015 (UTC) FILETIME=[F4B22E70:01C95B02]

This is a header of a message with STMP turned off and it apprears correctly in the email client

Microsoft Mail Internet Headers Version 2.0
Received: from psmtp.com ([64.18.2.140]) by domainname.com with Microsoft SMTPSVC(6.0.3790.3959);
Wed, 10 Dec 2008 14:04:28 -0600
Received: from source ([70.86.157.202]) (using TLSv1) by postini.com ([64.18.6.14]) with SMTP;
Wed, 10 Dec 2008 12:08:41 PST
Received: from xxxxxxx by domainname with local (Exim 4.69)
(envelope-from <xxxxxxx@domainname.com>)
id 1LAVMI-0000Qd-9Z
for xxxxxxx@domainname.com; Wed, 10 Dec 2008 14:08:34 -0600
To: xxxxxxx@kirkhamsystems.com
Subject: [Customer Newsletter] Newsletter title
Errors-To: sales@customerdomain.com
From: "Fianna Village Liquor and The xxxxxxx"
    <sales@customerdomain.com>
Content-Type: multipart/related;
    charset=utf-8;
    boundary="d6dab9320b40702ad17bce9a32156d75"
Reply-To: sales@customerdomain.com
X-Mailer: Drupal
MIME-Version: 1.0
Message-Id: <E1LAVMI-0000Qd-9Z@domainname>
Date: Wed, 10 Dec 2008 14:08:34 -0600
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - domainname.com
X-AntiAbuse: Original Domain - domainname.com
X-AntiAbuse: Originator/Caller UID/GID - [32021 32002] / [47 12]
X-AntiAbuse: Sender Address Domain - domainname.com
X-Source: /usr/bin/php
X-Source-Args: /usr/bin/php
X-Source-Dir: customerdomain.com:/public_html
X-pstn-neptune: 0/0/0.00/0
X-pstn-levels:     (S:25.80068/99.90000 CV:99.9000 P:95.9108 )
X-pstn-settings: 1 (0.1500:0.1500) cv gt3 gt2 gt1 p
X-pstn-addresses: from <sales@customerdomain.com> [101/5]
Return-Path: xxxxxxx@domainname.com
X-OriginalArrivalTime: 10 Dec 2008 20:04:28.0187 (UTC) FILETIME=[81C2F6B0:01C95B02]

--d6dab9320b40702ad17bce9a32156d75
Content-Type: multipart/alternative;
    boundary="798d6820eb777ff5ccfc89fdd9ec9080"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

--798d6820eb777ff5ccfc89fdd9ec9080
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

--798d6820eb777ff5ccfc89fdd9ec9080
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: base64


--798d6820eb777ff5ccfc89fdd9ec9080--
--d6dab9320b40702ad17bce9a32156d75
Content-ID: <0ecad1a8c91b4e055e986687b1fc5ef8@www.customerdomain.com>
Content-Type: image/jpeg; name="littlepenguinshiraz.jpg"
Content-Disposition: related; filename="littlepenguinshiraz.jpg"
Content-Transfer-Encoding: base64


--d6dab9320b40702ad17bce9a32156d75--

as far as I can tell the only difference between the headers of an email that does work and one that doesn't is that in the header of the one that works properly and doesn't have iamges I see this bit.

Content-Type: multipart/related;
    charset=utf-8;
    boundary="d6dab9320b40702ad17bce9a32156d75"

in the header itself and not in the body (different boundry number of course and some of the Content* are in the header and not in the body). Was hoping that someone else might be able to test this. I do have simplenews templates installed, but any images in the header or footer do not seem to cause this issue.

As of now I have a customer who can't use the SMTP module due to this issue, and I'm not completely certain if it's an issue with SMTP module or the Mime Mail module.

I need to use the SMTP module because out servers uses suphp and it sends as the username that the customer uses to log into the system and we need it to send out as the newsletter email address rather then the login name.

Granville
Kirkham Systems

#1

graper - January 20, 2009 - 22:07

I had to find a way to fix this and decided to dig around to see what it would take to fix, didn't realize it would have been this simple.

line 1341 of the smtp.module file needs to have this one line of code put in there.

// $Id: smtp.module,v 1.15.2.20 2008/06/18 15:53:16 oadaeh Exp $

$result .= $this->EndBoundary($this->boundary[1]);

this allowed images in html based newsletter posts to be sent properly instead of being sent as plain text with all the base64 encoding in the message itself. Please see that this gets into the next version of the module.

granville
Kirkham Systems Inc

#2

graper - January 22, 2009 - 21:05

Looks like I was wrong. I didn't have SMTP in use when I made the change and I am still not able view multipart emails properly when sent with the SMTP module turned on.

#3

oadaeh - February 7, 2009 - 18:44
Component:Miscellaneous» Code

@graper: I've been busy w/non-Drupal projects for a few months, but if I remember correctly, the 5.x version of this module didn't work correctly w/multi-part messages (and a lot of other things). I made some significant changes to the module when I ported it to 6.x with the intention of back-porting those changes to the 5.x version, but I haven't had the time to do it. I still have a few things to clean up with the 6.x port, and then I can start working on the 5.x back-port, but it may be a while yet, before I have the time to devote to it.

#4

joris.verschueren - May 12, 2009 - 13:15

First of all: thanks for the module, which would save me a lot of trouble with my mailhost. I do however have more or less the same problem as described above.

but: the test issues of the newsletters arrived spic and span!
moreover, when sending the newsletter for real, I myself received the proper newsletter also in normal HTML format, edited as intended + the trashed up version which my readers received. I guess that would have to do with the ability of my Gmail account to decipher multipart/alternative messages.

thanks,

Joris

#5

graper - May 14, 2009 - 18:19
Status:active» postponed

just to keep anyone who is only following this issue, this other issue #345448: SMTP, Mime Mail, Simple news and Images solve the problem for me, but the patch file is against the dev version and not the recommend version, but the fix is simple just the same.

Since the other issue makes a statement that the next drupal 5 version module will be a back-port of new code from the D6 version, I'm going to mark this myself as postponed.

#6

spatz4000 - May 14, 2009 - 18:35
Title:STMP, Mime Mail, Simple news and Images» SMTP, Mime Mail, Simple news and Images
 
 

Drupal is a registered trademark of Dries Buytaert.