Re: mutt/2147: Unbale to see the image as a part of email message body - mutt with -i option
The following reply was made to PR mutt/2147; it has been noted by GNATS.
From: Raj <jagtapr@xxxxxxxxx>
To: Moritz Barsnick <moritz+mutt@xxxxxxxxxxxx>, bug-any@xxxxxxxxxxxxx
Cc:
Subject: Re: mutt/2147: Unbale to see the image as a part of email message body
- mutt with -i option
Date: Wed, 14 Dec 2005 12:40:24 -0800 (PST)
--0-395425824-1134592824=:86646
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hi,
Thank you so much for the udpates and the examples. I am trying the example
as mentioned here. Will post the reply as soon as I have the results.
Thanks again
Raj
Moritz Barsnick <moritz+mutt@xxxxxxxxxxxx> wrote:
[Cc:ing to Raj for readability, as the BTS->mutt-dev make break some
things.]
Hi,
On Sat, Dec 10, 2005 at 07:35:01 +0100, TAKAHASHI Tamotsu wrote:
> HTML messages use ``'' to show images,
> but ``grep -i content-id ~/mutt/*.c'' returns nothing.
I think it's sufficient to attach an image
(Content-Disposition: attachment; filename="1.jpg")
and refer to that image with the HTML tag. At least
for Outlook.
> We can modify Content-Type and Content-Description with mutt,
> but mutt has no function to modify/create Content-Id.
Can this (the former) be done from mutt's command line? I couldn't
achieve it, and it seems such an HTML needs a few more quirks than just
Content-Type.
> If you write a sendmail-wrapper to
> * add a CID to each attachments
> * and s/attach1/cid:/,
> you can use ``'' to send HTML messages.
As a "POC" (proof of concept), I wrote this one line wrapper. It needs
mimencode for the base64 though, and required me to do some fiddling
with headers and boundaries - something mutt is much better at. ;-)
Here comes the really long line (feel free to hack it into a script
with parameters). I broke it at the '\$' places for readability:
( echo -e 'From: my_email\nTo: recipient@xxxxxxxxxx\n\
Subject: embedded image test\n\
Content-Type: multipart/mixed; boundary="bound"\n\n\n\
--bound\nContent-Type: text/html; charset=us-ascii\n\
Content-Disposition: inline\n\n\
\n--bound\n\
Content-Type: image/jpeg\n\
Content-Disposition: attachment; filename="1.jpg"\n\
Content-Transfer-Encoding: base64\n'; \
mimencode sendmail -oi -t -v
Only flaw:
The image will display inline _and_ be presented as an attachment in
Outlook...
HTH,
Moritz
---------------------------------
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
--0-395425824-1134592824=:86646
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
<DIV>Hi,</DIV> <DIV> </DIV> <DIV>Thank you so much for the udpates and
the examples. I am trying the example as mentioned here. Will post the reply as
soon as I have the results.</DIV> <DIV> </DIV> <DIV>Thanks again</DIV>
<DIV>Raj<BR><BR><B><I>Moritz Barsnick <moritz+mutt@xxxxxxxxxxxx></I></B>
wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT:
5px; BORDER-LEFT: #1010ff 2px solid">[Cc:ing to Raj for readability, as the
BTS->mutt-dev make break some<BR>things.]<BR><BR>Hi,<BR><BR>On Sat, Dec 10,
2005 at 07:35:01 +0100, TAKAHASHI Tamotsu wrote:<BR>> HTML messages use
``<IMG src="cid:foobar">'' to show images,<BR>> but ``grep -i content-id
~/mutt/*.c'' returns nothing.<BR><BR>I think it's sufficient to attach an
image<BR>(Content-Disposition: attachment; filename="1.jpg")<BR>and refer to
that image with the HTML <IMG src="http://us.f511.mail.yahoo.com/ym/1.jpg">
tag. At least<BR>for Outlook.<BR><BR>> We can modify Content-Type
and Content-Description with mutt,<BR>> but mutt has no function to
modify/create Content-Id.<BR><BR>Can this (the former) be done from mutt's
command line? I couldn't<BR>achieve it, and it seems such an HTML needs a few
more quirks than just<BR>Content-Type.<BR><BR>> If you write a
sendmail-wrapper to<BR>> * add a CID to each attachments<BR>> * and
s/attach1/cid:<THE-CID-OF-THE-FIRST-ATTACHMENT>/,<BR>> you can use ``<IMG
src="http://us.f511.mail.yahoo.com/ym/attach1">'' to send HTML
messages.<BR><BR>As a "POC" (proof of concept), I wrote this one line wrapper.
It needs<BR>mimencode for the base64 though, and required me to do some
fiddling<BR>with headers and boundaries - something mutt is much better at.
;-)<BR><BR>Here comes the really long line (feel free to hack it into a
script<BR>with parameters). I broke it at the '\$' places for
readability:<BR><BR>( echo -e 'From: my_email\nTo:
recipient@xxxxxxxxxx\n\<BR>Subject: embedded image test\n\<BR>Content-Type:
multipart/mixed; boundary="bound"\n\n\n\<BR>--bound\nContent-Type: text/html;
charset=us-ascii\n\<BR>Content-Disposition: inline\n\n\<BR><IMG
src="http://us.f511.mail.yahoo.com/ym/1.jpg">\n--bound\n\<BR>Content-Type:
image/jpeg\n\<BR>Content-Disposition: attachment;
filename="1.jpg"\n\<BR>Content-Transfer-Encoding: base64\n'; \<BR>mimencode
<THE_IMAGE.JPG; \<br | ) ?\n--bound--\n? -e echo>sendmail -oi -t -v<BR><BR>Only
flaw: <BR>The image will display inline _and_ be presented as an attachment
in<BR>Outlook...<BR><BR>HTH,<BR>Moritz<BR></BLOCKQUOTE> <DIV><BR></DIV><p>
<hr size=1>Yahoo! Shopping<br>
Find Great Deals on Holiday Gifts at <a
href="http://us.rd.yahoo.com/mail_us/footer/shopping/*http://shopping.yahoo.com/;_ylc=X3oDMTE2bzVzaHJtBF9TAzk1OTQ5NjM2BHNlYwNtYWlsdGFnBHNsawNob2xpZGF5LTA1
">Yahoo! Shopping</a>
--0-395425824-1134592824=:86646--