A query about the Boundary

Giganews Newsgroups
Subject: A query about the Boundary
Posted by:  Igor (clarkecomputers.te…@gmail.com)
Date: Wed, 05 Jul 2006

Hi

I've got an unusual problem.
The software I'm working on allows you to send an email message that contains
HTML text, and plain text version of the HTML and a PDF attachment.
Creating the email is no problem, and it seems most email programs display the
email the way it's meant to be shown.

Today I got a message from a client saying that a program called Mail Scanner
rejected the email because it said the email is not correctly formatted.  We
looked into it and found that the email doesn't comply with RFC2046 to do with
the boundary. It was saying that a boundary cannot be contained in any of the
encapsulated parts.

I had a quick look in Indy and found that Indy generates a boundary string and
later in the attached parts just adds a random letter to the existing boundary
string. I will include the source of a test email that shows this.

If you take a note of the boundary string, all Indy does is add the letter "w"
to the end of the same boundary string.
Mail Scanner seems to take issue with this.

Any help appreciated.

Regards,
Igor

(note: I have overwritten the original email addresses)
------ EMAIL SOURCE ---------
From - Wed Jul 05 09:43:11 2006
X-Account-Key: account3
X-UIDL: UID3814-1125991399
X-Mozilla-Status: 0001
X-Mozilla-Status2: 10000000
Return-Path: <v####@#######.com.au>
Delivered-To: clar########@####.net.au
Received: (qmail 26865 invoked from network); 4 Jul 2006 23:38:28 -0000
Received: from unknown (HELO mail-ihug.icp-qv1-irony5.iinet.net.au) ([203.59.1.199])
          (envelope-sender <v####@#######.com.au>)
          by mail.iinet.net.au (qmail-ldap-1.03) with SMTP
          for <clar########@####.net.au>; 4 Jul 2006 23:38:28 -0000
Received: from server-02.pop.au.hostweb.com.au (HELO
server-02.au.hostweb.com.au) ([203.188.136.160])
  by mail-ihug.icp-qv1-irony5.iinet.net.au with ESMTP; 05 Jul 2006 07:38:27 +0800
Received: from [203.59.1.199] (helo=mail-ihug.icp-qv1-irony5.iinet.net.au)
    by server-02.au.hostweb.com.au with esmtp (Exim 4.52)
    id 1FxuTN-0000uc-F2
    for su#####@clar#####s.com.au; Wed, 05 Jul 2006 07:38:29 +0800
Received: from 124-168-26-216.dyn.iinet.net.au (HELO mark) ([124.168.26.216])
  by mail-ihug.icp-qv1-irony5.iinet.net.au with ESMTP; 05 Jul 2006 07:38:22 +0800
Message-Id: <53binj$oktr…@iinet-mail.icp-qv1-irony5.iinet.net.au>
X-BrightmailFiltered: true
X-Brightmail-Tracker: AAAAAA==
X-IronPort-AV: i="4.06,206,1149436800";
    d="pdf'?scan'208"; a="827256288:sNHT64347744"
From: "######## Real Estate" <v####@#######.com.au>
Subject: Financial Year End Statement: 16/ 5/06
To: "ANTHONY ADAM" <su#####@clar#####s.com.au>
Content-Type: multipart/mixed; boundary="HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWz"
MIME-Version: 1.0
Date: Wed, 5 Jul 2006 09:38:23 +1000
X-Mailer: Rent Trust version 2006.026
X-Source:
X-Source-Args:
X-Source-Dir:

This is a multi-part message in MIME format

--HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWz
Content-Type: multipart/alternative;
        boundary="HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWzw"

--HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWzw
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Attached please find your Financial Year End statement (Sent: 16/ 5/06).

--HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWzw
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

Attached please find your Financial Year End statement (Sent: 16/ 5/06).

--HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWzw--

--HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWz
Content-Type: application/octet-stream;
        name="YTD434-06-05-16.PDF"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
        filename="YTD434-06-05-16.PDF"

JVBERi0xLjQNCiXi48/TDQolIA0KJTEwMDI1MFsyOTJdDQoxIDAgb2JqIA08PA0KL1Byb2R1Y2Vy

==== BLOCK SNIPPED ====

NDc5IDAwMDAwIG4NCjAwMDAwMTk3MTAgMDAwMDAgbg0KMDAwMDAyMDI4OSAwMDAwMCBuDQp0cmFp
bGVyCjw8Ci9TaXplIDMzDQovUm9vdCAzMiAwIFINCi9JRFs8NDc0ZTQ5NGU0NzUzNGE0MTVhNDQ1
NTUyNTQ0YjQ4NTQ+PDQ3NGU0OTRlNDc1MzRhNDE1YTQ0NTU1MjU0NGI0ODU0Pl0NCi9JbmZvIDEg
MCBSDQo+Pg0Kc3RhcnR4cmVmDQoyMDQxNA0KJSVFT0YNCg==

--HufHcpx6uauJrzgN=_mZMmCfZjp1fALXWz--

------ END EMAIL SOURCE -----

Replies