Discussion:
v 2.4 and still problems with attachments
T***@macrosoft.pl
2005-01-18 22:24:17 UTC
Permalink
I'm sendig e-mail with new blat 2.4, and have still problems with
attachments. I think there isn't defined mixed-part boundary.

If I try to use commandline like:

blat
html.file
-tf rcv.file
-subject "test"
-debug
-log blat.log
-html
-alttextf alttest.file
-embed embed.file
-attach binary.file

my message is like:

Content-Type: multipart/related; boundary="=_related_="
--=_related_=
Content-Type: multipart/alternative; boundary="=_alternative_="
--=_alternetive_=
Content-Type: text/plain
...
--=_alternetive_=
Content-Type: text/html
...
--=_alternetive_=--
--=_related_=
Content-Type: image/gif
... (embed gif)
--=_related_=--
--=_maybe_mixed_but_not_defined_=
Content-Type: application/octed-stream
... (binary attachment)
--=_maybe_mixed_but_not_defined_=--

Tom

[Non-text portions of this message have been removed]
--
Homepage:
http://www.blat.net
Chip
2005-01-19 03:01:55 UTC
Permalink
Post by T***@macrosoft.pl
I'm sendig e-mail with new blat 2.4, and have still problems with
attachments. I think there isn't defined mixed-part boundary.
blat
html.file
-tf rcv.file
-subject "test"
-debug
-log blat.log
-html
-alttextf alttest.file
-embed embed.file
-attach binary.file
Content-Type: multipart/related; boundary="=_related_="
--=_related_=
Content-Type: multipart/alternative; boundary="=_alternative_="
--=_alternetive_=
Content-Type: text/plain
...
--=_alternetive_=
Content-Type: text/html
...
--=_alternetive_=--
--=_related_=
Content-Type: image/gif
... (embed gif)
--=_related_=--
--=_maybe_mixed_but_not_defined_=
Content-Type: application/octed-stream
... (binary attachment)
--=_maybe_mixed_but_not_defined_=--
Tom
Which email client and version are you using to read these messages? If you
are using Lotus Notes to read these messages, I woiuld suggest that Notes is
your problem, not Blat. I just sent to myself a message using your options
above, and Outlook Express shows the html just fine, with one attachment.
When I change Outlook Express to read in plain text only, then I get the
alternate text and all other stuff is listed as attachments (as expected).
The message I sent with Blat does have the multipart/mixed content-type
header.

The message is listed below, with all the base64 encoding stripped.

Chip

--------

Received: from localhost
Date: Tue, 18 Jan 2005 21:48:46 -0500
From: Chip
To: Chip
Message-ID: <01c4fdd1$Blat.v2.4$***@localhost>
Subject: test
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="=_BlatBoundary-CsjEzAmp61OnirTcHjhTU"

This is a multi-part message in MIME format.

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTU
Content-Type: multipart/related;
type="multipart/alternative";
boundary="=_BlatBoundary-CsjEzAmp61OnirTcHjhTV"

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: multipart/alternative;
boundary="=_BlatBoundary-CsjEzAmp61OnirTcHjhTW"

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTW
Content-Transfer-Encoding: 7BIT
Content-Type: text/plain; format=flowed; charset=ISO-8859-1

-p attmail -embed *.jpg,*.png,*.gif ; this is a comment
-s "How to send html with a background"
-attach *.jpg -debug

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTW
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<=21DOCTYPE html PUBLIC =22-//W3C//DTD HTML 3.2//EN=22>
<html>
<head>
<meta content=3D=22HTML Tidy for Windows (vers 1st February 2003), s=
ee www.w3.org=22 name=3D=22generator=22>
<title>
Test
</title>
<meta http-equiv=3D=22refresh=22 content=3D=223;=22>
</head>
<body background=3D=22cid:ibmback.gif=22>
<center>
<table border>
<caption>
Testing images in html files...
</caption>
<tr>
<td align=3D=22center=22>
<img src=3D=22cid:blat.png=22 alt=3D=22=22><br>
<img src=3D=22cid:Camel.gif=22 alt=3D=22=22><br>
<img src=3D=22cid:perl.gif=22 alt=3D=22=22><br>
<img src=3D=22cid:VIm.png=22 alt=3D=22=22> <img src=3D=22cid=
:Apache.png=22 alt=3D=22=22>
</td>
<td> <img src=3D=22cid:TBlogo.jpg=22 alt=3D=22=22> </td>
</tr>
<tr>
<td colspan=3D=222=22 align=3D=22center=22>
<img src=3D=22cid:CCNA-45x38.png=22 alt=3D=22=22> <img src=3D=
=22cid:dolphins.gif=22 alt=3D=22=22>
</td>
</tr>
</table>
</center>
</body>
</html>

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTW--

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/png;
name="Apache.png"
Content-ID: <Apache.png>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/png;
name="blat.png"
Content-ID: <blat.png>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/png;
name="CCNA-45x38.png"
Content-ID: <CCNA-45x38.png>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/png;
name="VIm.png"
Content-ID: <VIm.png>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/gif;
name="Camel.gif"
Content-ID: <Camel.gif>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/gif;
name="dolphins.gif"
Content-ID: <dolphins.gif>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/gif;
name="ibmback.gif"
Content-ID: <ibmback.gif>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/gif;
name="perl.gif"
Content-ID: <perl.gif>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV
Content-Type: image/jpeg;
name="TBlogo.jpg"
Content-ID: <TBlogo.jpg>
Content-Disposition: INLINE
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTV--

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTU
Content-Type: application/x-msdownload;
name="blat.zl9"
Content-Disposition: ATTACHMENT;
filename="blat.zl9"
Content-Transfer-Encoding: BASE64

...

--=_BlatBoundary-CsjEzAmp61OnirTcHjhTU--
--
Homepage:
http://www.blat.net
T***@macrosoft.pl
2005-01-19 07:43:08 UTC
Permalink
Post by Chip
Which email client and version are you using to read these messages? If
you
Post by Chip
are using Lotus Notes to read these messages, I woiuld suggest that
Notes is
Post by Chip
your problem, not Blat. I just sent to myself a message using your
options
Post by Chip
above, and Outlook Express shows the html just fine, with one
attachment.
Post by Chip
When I change Outlook Express to read in plain text only, then I get the
alternate text and all other stuff is listed as attachments (as
expected).
Post by Chip
The message I sent with Blat does have the multipart/mixed content-type
header.
Problem is with order of commandline options. It works fine:

blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -embed powered.gif -attach powered.gif

but it's wrong:

blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -attach powered.gif -embed powered.gif

Tom

[Non-text portions of this message have been removed]
--
Homepage:
http://www.blat.net
Chip
2005-01-19 08:55:24 UTC
Permalink
Post by T***@macrosoft.pl
blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -embed powered.gif -attach powered.gif
blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -attach powered.gif -embed powered.gif
Tom
Ok, you now know which order to use the -embed and -attach/-attacht options.
:)

I would like to suggest that you stop using the -html option if your message
file has a .htm or .html extension. If you send html messages, and have a
text file attachment (-attacht), bad things could happen for your recipient,
meaning that the text file attachment will be marked text/html whether or
not that file is html, and their email reader may try to render the text
attachment in html.

The -html option is for message files that do not have a .htm or .html
extension, or where you want to force text/html content-type header when the
message file might use a different type.

A future version (2.4.1?) will have the attachments sorted by type, where
embedded attachments are first, binary attachments are second, and text
attachments are last. In this sequence, Blat will build the message
sections properly as if you used the -embed before the -attach option on the
command line. The initial code has already been done and tested, but I need
to work one more item.

Chip
--
Homepage:
http://www.blat.net
T***@macrosoft.pl
2005-01-19 08:39:12 UTC
Permalink
And also problem is with:

blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -embed powered.gif -af attach.file

but not with:

blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -embed powered.gif -attach powered.gif


Tom

[Non-text portions of this message have been removed]
--
Homepage:
http://www.blat.net
Chip
2005-01-20 14:43:47 UTC
Permalink
Post by T***@macrosoft.pl
I'm sendig e-mail with new blat 2.4, and have still problems with
attachments. I think there isn't defined mixed-part boundary.
blat
html.file
-tf rcv.file
-subject "test"
-debug
-log blat.log
-html
-alttextf alttest.file
-embed embed.file
-attach binary.file
<snip>
Post by T***@macrosoft.pl
Tom
------------------------------------------------------------------------
Post by T***@macrosoft.pl
blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -embed powered.gif -attach powered.gif
blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -attach powered.gif -embed powered.gif
Tom
------------------------------------------------------------------------
Post by T***@macrosoft.pl
blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -embed powered.gif -af attach.file
blat html.file -tf rcv.file -subject "test" -debug -log blat.log -html
-alttextf text.file -embed powered.gif -attach powered.gif
Tom
------------------------------------------------------------------------

These issues that Tom found were not identified during my testing of the
2.40 code mainly because in my head I knew the order in which things should
be sent, namely that embedded items go first followed by attached items, and
because when I sent embedded graphics I also sent alternate text that can be
read by more restrictive email clients. This is one of the flaws with being
more familiar with the code and how stuff should appear, I (and others)
overlook the less obvious and therefore do not test exactly the way others
will use this program.

To solve these items listed above required only about a dozen lines of code.
The first issue is the order of the options -embed and -attach when used
together. As released in 2.40 this week, -embed needs to be used before
the -attach and -attacht options in order for the embedded items to work
properly. The solution that I came up with in code was to sort the
attachments themselves by type, forcing embedded items to the front of the
list. The second issue that Tom points out is when using -af option I had
forgotten to set a flag indicating there are attachments. This flag is new
to 2.40, it was being set if you use -attach option, but I overlooked
setting it when you use the -af option. The side effect of not setting this
flag is that the message boundaries and content-type markers may not be
created properly.

These are now known issues with 2.40, have been corrected in the source code
here at home, tested and set to Tom for verification. However, before I
create a 2.41 release, I want to make sure there aren't any other issues
that I overlooked or broke in the process of creating 2.40. I am asking
that if you find any issues, please write about it, give the command line
you used and any options in other files in case ordering is at fault. If
possible, also use -debug and -log options and include the log file after
you have _changed_ all personal information including anything that even
appears to be encrypted. Leave the encrypted stuff there, but change it all
to hyphens or ## characters. This way I/we check the source based on the
events from your logs. -Superdebug provides more information than -debug,
but this can be more difficult to erase/change your personal information in
the logs. Submit -superdebug/-superdebugt log files only if you are
absolutely certian that you have erased or changed all personal information
including email addresses, server names, and encrypted userids/passwords.

Thanks for listening,

Chip
--
Homepage:
http://www.blat.net
Loading...