[Mailman-Users] Mailman/PHP/Digest Issue
Neal Berwick
remigus at gmail.com
Wed Sep 21 19:58:46 CEST 2005
Hey All,
My apologies in advance if I'm directing this to the wrong location, but
I'm about out of ideas. I recently built a small PHP web form to allow
individuals to send email updates to our various mailman lists. Everything
works quite nicely for non-digest users, but when I tried to configure the
script for digest users, things started to get weird.
Initially, no matter how many emails I dispatched using the form, the
Mailman digest always listed a single topic. In the MIME digest it attached
a single message (the first message sent to the list) and in plaintext it
appended all the messages sent to the list but still listed as a single
message. The headers where all subsequent messages were to start seemed
pretty messed up. So I decided to play with the headers a bit and added the
line in the php:
$headers .= "X-Mailer: PHP/" . phpversion() . "\n";
After that change all digests calculated the number of messages correctly
and displayed the headers accurately. Unfortunately, though every thing
looks good in digest/plaintext, digest/MIME was acting up. When a MIME
digest was received in Outlook, the messages were not attached to the
digest. Yet when I sent to a gmail account they appeared below as forwarded
messages. Now if I forsake the php form and send MIME email from outlook to
the list Outlook correctly creates a multipart/alternative email and the
MIME/digest contains appropriate attachments for all messages.
Below I list the headers that I'm setting in php, the relevant sections of
the plaintext digest with incorrectly counted messages/topics and finally
the relevant sections of the plaintext digest with the correct message
count.
Thanks in advance to anyone who has any thoughts
php:
$boundary='--' . md5( uniqid("IsNealAGenius") );
$headers = "From: \"Home Office\" <" . $from. ">\n";
$headers .= "Mime-Version: 1.0\n";
$headers .= "Content-type: multipart/alternative;\n boundary=\"$boundary\"\n
X-Mailer: PHP/" . phpversion() . "\n";
$message="\nThis is a multi-part message in MIME format.\n";
$message.="\n\n--$boundary\n";
$message.="Content-Type: text/plain; charset=\"us-ascii\"\n";
$message.="Content-Transfer-Encoding: 8bit\n\n";
$mail_to = "test_list at here.com";
$message .= strip_tags($test);
$message .= "\n\n--$boundary\n";
$message .= "Content-Type: text/html; charset=\"us-ascii\"\n";
$message.="Content-Transfer-Encoding: 8bit\n\n";
$message .= $test;
mail ($mail_to,"test",$message,$headers);
......................................................................................
plaintext digest 1.
Today's Topics:
1. test (Home Office)
----------------------------------------------------------------------
Date: Wed, 21 Sep 2005 10:19:36 -0400 (EDT)
From: "Home Office" neal at here.com
To: test_list at here.com
Subject: [Test_list] test
Message-ID: 20050921141936.AF158524114 at mail.here.com
Content-Type: multipart/alternative;
boundary="--274280a87c2f32840e53791334dfb49f"
MIME-Version: 1.0
Precedence: list
Message: 1
This is a multi-part message in MIME format.
----274280a87c2f32840e53791334dfb49f
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
<stripped HTML here.>
----274280a87c2f32840e53791334dfb49f
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 8bit
<Real HTML here>
----274280a87c2f32840e53791334dfb49f--
>From apache at here.com Wed Sep 21 10:19:51 2005
Return-Path: apache at here.com
X-Original-To: test_list at here.com
Delivered-To: test_list at here.com
Received: by mail.here.com <http://mail.here.com> (Postfix, from userid 48)
id 0952E52406B; Wed, 21 Sep 2005 10:19:51 -0400 (EDT)
To: test_list at here.com
From: "Home Office" neal at here.com
Mime-Version: 1.0
Content-type: multipart/alternative;
boundary="--921e4b971d970fe077e26dadad939251"
Message-Id: 20050921141951.0952E52406B at mail.here.com
Date: Wed, 21 Sep 2005 10:19:51 -0400 (EDT)
Subject: [Test_list] test
X-BeenThere: test_list at here.com
X-Mailman-Version: 2.1
Precedence: list
List-Id: Test list to work out bugs <test_list.here.com>
List-Unsubscribe:
<*http://www.here.com/mailman/listinfo/test_list*<http://www.here.com/mailman/listinfo/test_list>
>,
<*mailto:test_list-request at here.com?subject=unsubscribe*<test_list-request at here.com?subject=unsubscribe>
>
List-Archive: </heremail>
List-Post: <*mailto:test_list at here.com* <test_list at here.com>>
List-Help: <*mailto:test_list-request at here.com?subject=help*<test_list-request at here.com?subject=help>
>
List-Subscribe:
<*http://www.here.com/mailman/listinfo/test_list*<http://www.here.com/mailman/listinfo/test_list>
>,
<*mailto:test_list-request at here?subject=subscribe*<test_list-request at here?subject=subscribe>
>
This is a multi-part message in MIME format.
----921e4b971d970fe077e26dadad939251
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit .....
<Rest of message>
............................................................
plaintext digest #2:
Today's Topics:
1. test (Home Office)
2. test (Home Office)
3. test (Home Office)
----------------------------------------------------------------------
Date: Wed, 21 Sep 2005 09:56:42 -0400 (EDT)
From: "Home Office" neal at here.com
To: test_list at here.com
Subject: [Test_list] test
Message-ID: 20050921135642.7C15B52406B at mail.here.com
Content-Type: multipart/alternative;
boundary="--c9dff2da6d2e9942c846b891d664122e"
X-Mailer: PHP/4.3.2
MIME-Version: 1.0
Precedence: list
Message: 1
This is a multi-part message in MIME format.
----c9dff2da6d2e9942c846b891d664122e
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
<Plain text here>
----d9d51c58d8acd322402f930ba7754354
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 8bit
<HTML here>
----01f73f678c4ca55f470d0225d6131bb2
------------------------------
Date: Wed, 21 Sep 2005 13:28:37 -0400 (EDT)
From: "Home Office" neal at here.com
To: test_list at here.com
Subject: [Test_list] test
Message-ID: 20050921172837.6110952406B at mail.here.com
Content-Type: multipart/alternative;
boundary="--7cdc89be99811720df8db7a5ddb7bc0e"
X-Mailer: PHP/4.3.2
MIME-Version: 1.0
Precedence: list
Message: 2
This is a multi-part message in MIME format.
----7cdc89be99811720df8db7a5ddb7bc0e
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
<rest of message>
More information about the Mailman-Users
mailing list