Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I send a PDF file in mutt??

475 views
Skip to first unread message

Gary Quiring

unread,
Sep 26, 2005, 8:47:51 AM9/26/05
to
I need to send a PDF file via the command line that has bitmaps in it. Mutt is
sending the file as plain text. What/where do I control the binary options?


I am using Mutt 1.4.2i

Thanks
Gary Quiring

Alan Connor

unread,
Sep 26, 2005, 9:34:05 AM9/26/05
to
On comp.mail.mutt, in
<oarfj1p5t4qbqjela...@4ax.com>, "Gary Quiring"
wrote:

> I need to send a PDF file via the command line that has bitmaps
> in it. Mutt is sending the file as plain text. What/where do
> I control the binary options?

Not sure I'm following you. You can't send binary files via SMTP.
They have to be converted to ascii (mimencode or uuencode, etc.)
at your end, then re-converted to binary at the other.

SMTP is not FTP :-)

mutt <address> -s "subject" -a <pdf file>

should do the trick. The file will be converted to mime and sent
as an attachment.

If you just want to use the mails to transfer a PDF file, then
convert it to ascii with the mimencode utility and include it in
the body of the mail with the -i option. (In that case, you may
as well gzip it first). But the recipient will have probably have
to do the re-conversions themselves, because most mail clients
aren't designed for that.

Hope that's clear,

AC


--
Homepage: http://home.earthlink.net/~alanconnor/
Fanclub: http://www.pearlgates.net/nanae/kooks/alanconnor.shtml

D P Schreber

unread,
Sep 26, 2005, 9:37:37 AM9/26/05
to
On 2005-09-26, Gary Quiring <gqui...@msn.com> wrote:
> I need to send a PDF file via the command line that has bitmaps in it.
> Mutt is sending the file as plain text. What/where do I control the
> binary options?

Use -a to attach the file as a MIME object, instead of -i, which
includes it in the body.

Gary Quiring

unread,
Sep 26, 2005, 9:59:10 AM9/26/05
to

I am sending this this script:
#!/bin/ksh
SUB="Test Mutt"
ATTACH="INV_767580_20050921.pdf"
TO_ADDR="x...@abc.com"
MESSSAGE="Hello"

mutt -x -s "${SUB}" -c "${CC_ADDR}" -b "${BCC_ADDR}" -a "${ATTACH}" \
-e "my_hdr From: ${FROM_ADDR}" "${TO_ADDR}"<<SEND_ATTACH

${MESSAGE}

SEND_NO_ATTACH

It does not work, it thinks the PDF is text. If the PDF has no .bmp files
(company logo) it works fine. With a company logo it garbles the PDF file.

Alan Connor

unread,
Sep 26, 2005, 10:53:50 AM9/26/05
to

I hate to say it, but this really looks like a neophyte spammer
learning the trade, doesn't it?

Why else would he want to change the From address from mail to
mail?

http://groups.google.com/advanced_group_search

Gary Quiring
Results 1 - 54 of 54 posts in the last year
2 alt.cellular.verizon
1 alt.comp.periphs.mainboard.asus
1 alt.os.linux.suse
15 comp.databases.informix
1 comp.lang.java.help
7 comp.lang.php
3 comp.mail.misc
1 comp.mail.mutt
6 comp.mail.sendmail
2 comp.unix.sco.misc
14 comp.unix.solaris
1 rec.audio.marketplace

His supposed NNTP-Posting-Host IP is useless:

$ host -a 5380256c.authen.white.readfreenews.net
5380256c.authen.white.readfreenews.net does not exist, try again

$ whois 5380256c.authen.white.readfreenews.net

Whois Server Version 1.3

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

No match for "5380256C.AUTHEN.WHITE.READFREENEWS.NET".

Octanews and readfreenews are that scumbag Mike Horwath's
newsservers. He has more trolls as clients than all of the
others put together. Check out alt.free.newsservers if you don't
believe me. He posts there all the time, often using the the
X-No-Archive: yes header for the simple reason that he trolls
all the time himself.


AC

Alan Connor

unread,
Sep 26, 2005, 11:40:32 AM9/26/05
to

There's this fellow over on comp.editors who's been asking how
to make vim convert selected words to all upper-case with a
key-stroke:

Mlaky
Results 1 - 3 of 3 posts in the last year
1 comp.editors
2 hr.ponuda.gsm

He's posting through an ISP in the Netherlands.

83.131.89.3

I suspect that it is the same person.

AC


Gary Quiring

unread,
Sep 26, 2005, 3:25:51 PM9/26/05
to
On Mon, 26 Sep 2005 14:53:50 GMT, Alan Connor <i3x...@j9n35c.invalid> wrote:


>
>I hate to say it, but this really looks like a neophyte spammer
>learning the trade, doesn't it?
>
>Why else would he want to change the From address from mail to
>mail?
>

You guys are a bunch of yo-yo's. I guess UNIX cron jobs never factored into
your brain waves. I have to invoice our dealers. A root cron job sends the
email. Do you really think I want my customers seeing ro...@server.company.com?
I change the email to an email they can respond to.

So I guess since you guys HAVE NO answers you like to sway the topic somewhere
else.

Gary Quiring


Tim Hammerquist

unread,
Sep 26, 2005, 6:05:46 PM9/26/05
to
Gary Quiring <gqui...@msn.com> wrote:
> I need to send a PDF file via the command line that has
> bitmaps in it. Mutt is sending the file as plain text.
> What/where do I control the binary options?

When using the -a switch, mutt attaches the file using mime.
There is no "plain text/binary" distinction. Only 7bit/8bit,
and mutt defaults to using 7bit unless explicitly told
otherwise.

I can think of two possibilities off the top of my head that
might be causing your problem:

1) The recipient email app is failing to decode the attachment
properly.
2) The attachment (pdf) was garbled before it was attached.

Have you tested the pdf on the originating machine before
sending it? Try sending it to another host via scp.

If it works before being sent, ensure 'use_8bitmime' is *off* in
your muttrc file, attach, and send. Try to access the
attachment from a few different MUAs and email addresses, to try
to rule out client malfunction.

If you still can't figure it out, and not one single recipient
mailbox gets a clean attachment, post your results back here.

Tim Hammerquist

Alan Connor

unread,
Sep 26, 2005, 6:10:54 PM9/26/05
to
On comp.mail.mutt, in
<bhigj1p5kbvmntgsu...@4ax.com>, "Gary Quiring"
wrote:

> On Mon, 26 Sep 2005 14:53:50 GMT, Alan Connor
> <i3x...@j9n35c.invalid> wrote:
>
>
>
>>I hate to say it, but this really looks like a neophyte spammer
>>learning the trade, doesn't it?
>>
>>Why else would he want to change the From address from mail to
>>mail?
>
> You guys are a bunch of yo-yo's. I guess UNIX cron jobs
> never factored into your brain waves. I have to invoice our
> dealers. A root cron job sends the email. Do you really think
> I want my customers seeing ro...@server.company.com? I change
> the email to an email they can respond to.

That doesn't take a variable, just the address.

>
> So I guess since you guys HAVE NO answers you like to sway the
> topic somewhere else.
>
> Gary Quiring
>
>

That guy on comp.editors is incredibly rude too. Called an answer
he didn't like "stupid".

Notice the continuing lack of a company name.

AC

Gary Quiring

unread,
Sep 26, 2005, 10:25:19 PM9/26/05
to
On Mon, 26 Sep 2005 22:05:46 GMT, Tim Hammerquist <t...@vegeta.ath.cx>
wrote:

I can send zip files with no issues. I can also send PDF files that
do not have bmp logos with no issues. I have sent the file to my
gmail and MSN accounts and the PDF is not readable. The problem is
PDF with logos (.bmp). The PDF on the Unix box is valid, I can copy
it via Samba (or ftp) to my Windows box and it is viewable. I have no
entries in my .muttrc file.

I am guessing that mutt looks at some portion of the file and
determines it is text. Is there a way to force the attachment to be 8
bit? The script worked when it was running on SCO with mutt 1.2.5.
All email clients could read the PDF files.

Thanks
Gary Quiring


Tim Hammerquist

unread,
Sep 26, 2005, 11:39:27 PM9/26/05
to
Gary Quiring <gqui...@msn.com> wrote:

> Tim Hammerquist <t...@vegeta.ath.cx> wrote:
> > When using the -a switch, mutt attaches the file using mime.
> > There is no "plain text/binary" distinction. Only
> > 7bit/8bit, and mutt defaults to using 7bit unless explicitly
> > told otherwise.
> >
> > I can think of two possibilities off the top of my head that
> > might be causing your problem:
> >
> > 1) The recipient email app is failing to decode the
> > attachment properly.
> > 2) The attachment (pdf) was garbled before it was attached.
> >
> > Have you tested the pdf on the originating machine before
> > sending it? Try sending it to another host via scp.
> >
> > If it works before being sent, ensure 'use_8bitmime' is
> > *off* in your muttrc file, attach, and send. Try to access
> > the attachment from a few different MUAs and email
> > addresses, to try to rule out client malfunction.
> >
> > If you still can't figure it out, and not one single
> > recipient mailbox gets a clean attachment, post your results
> > back here.
>
> I can send zip files with no issues. I can also send PDF
> files that do not have bmp logos with no issues. I have sent
> the file to my gmail and MSN accounts and the PDF is not
> readable. The problem is PDF with logos (.bmp). The PDF on
> the Unix box is valid, I can copy it via Samba (or ftp) to my
> Windows box and it is viewable. I have no entries in my
> .muttrc file.
>
> I am guessing that mutt looks at some portion of the file and
> determines it is text. Is there a way to force the attachment
> to be 8 bit? The script worked when it was running on SCO
> with mutt 1.2.5. All email clients could read the PDF files.

The whole point of MIME (and I daresay all email attachment
methods) is to make all data contained therein "7-bit clean" so
it doesn't *get* garbled by MTAs which can only handle 7-bit
data. IOW, you don't want 8-bit.

You mention it worked with a previous version of mutt, and
I assume you used the -a switch with that... and I also notice
you're still using an old version of mutt (1.4.x). Upgrade your
mutt and try again.

If it still doesn't work, try posting the *valid* PDF file with
BMP images embedded on a web server somewhere so someone here
can try to reproduce your issue, as I have never *ever*
personally seen mutt's MIME corrupt an attachment.

HTH,
Tim Hammerquist

Grant Edwards

unread,
Sep 27, 2005, 1:06:43 AM9/27/05
to
On 2005-09-26, Gary Quiring <gqui...@msn.com> wrote:
> On Mon, 26 Sep 2005 14:53:50 GMT, Alan Connor <i3x...@j9n35c.invalid> wrote:
>
>
>>
>>I hate to say it, but this really looks like a neophyte spammer
>>learning the trade, doesn't it?
>>
>>Why else would he want to change the From address from mail to
>>mail?
>
> You guys are a bunch of yo-yo's.

You guys? AC is more than one person? Actually that does
explain a few things.

> I guess UNIX cron jobs never factored into your brain waves.
> I have to invoice our dealers. A root cron job sends the
> email. Do you really think I want my customers seeing
> ro...@server.company.com? I change the email to an email they
> can respond to.
>
> So I guess since you guys HAVE NO answers you like to sway the
> topic somewhere else.

Not sure what I did to deserve being painted with this brush...

--
Grant Edwards grante Yow! Two with FLUFFO,
at hold th' BEETS...side of
visi.com SOYETTES!

Gary Johnson

unread,
Sep 27, 2005, 1:26:42 AM9/27/05
to
Tim Hammerquist <t...@vegeta.ath.cx> wrote:
> Gary Quiring <gqui...@msn.com> wrote:

>> I can send zip files with no issues. I can also send PDF
>> files that do not have bmp logos with no issues. I have sent
>> the file to my gmail and MSN accounts and the PDF is not
>> readable. The problem is PDF with logos (.bmp). The PDF on
>> the Unix box is valid, I can copy it via Samba (or ftp) to my
>> Windows box and it is viewable. I have no entries in my
>> .muttrc file.
>>
>> I am guessing that mutt looks at some portion of the file and
>> determines it is text. Is there a way to force the attachment
>> to be 8 bit? The script worked when it was running on SCO
>> with mutt 1.2.5. All email clients could read the PDF files.
>
> The whole point of MIME (and I daresay all email attachment
> methods) is to make all data contained therein "7-bit clean" so
> it doesn't *get* garbled by MTAs which can only handle 7-bit
> data. IOW, you don't want 8-bit.
>
> You mention it worked with a previous version of mutt, and
> I assume you used the -a switch with that... and I also notice
> you're still using an old version of mutt (1.4.x). Upgrade your
> mutt and try again.
>
> If it still doesn't work, try posting the *valid* PDF file with
> BMP images embedded on a web server somewhere so someone here
> can try to reproduce your issue, as I have never *ever*
> personally seen mutt's MIME corrupt an attachment.

Some e-mail clients don't handle CR-LF sequences correctly when
quoted-printable encoding is used. I've only observed this problem
myself with PDF attachments that were sent from Outlook. I never
did find out whether it was Outlook's encoding or mutt's decoding
that was at fault. The problem is discussed in one of the MIME
RTFs--I don't know the number off hand. It could be that mutt is
encoding the attachment correctly but that the receiving client is
decoding it incorrectly.

One way around this problem is to force mutt to encode the PDF
attachment using base64 instead of quoted-printable. This can be
done from mutt's Compose menu by typing ^E.

HTH,
Gary

Gary Quiring

unread,
Sep 27, 2005, 7:55:58 AM9/27/05
to

I cannot get the 1.5 version to compile on Solaris 9:

Undefined first referenced
symbol in file
initscr32 main.o
w32addch curs_lib.o
w32attron menu.o
w32attrset compose.o
acs32map menu.o
getcurx curs_lib.o
getcury curs_lib.o
ld: fatal: Symbol referencing errors. No output written to mutt
collect2: ld returned 1 exit status
make[2]: *** [mutt] Error 1
make[2]: Leaving directory `/u/local/src/mutt-1.5.10'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/u/local/src/mutt-1.5.10'
make: *** [all] Error 2

I will work on a PDF that I can post. The current PDF is a real invoice.

Thanks
Gary


Paul Walker

unread,
Sep 27, 2005, 4:38:58 AM9/27/05
to
On Mon, 26 Sep 2005 22:25:19 -0400, Gary Quiring wrote:

> I can send zip files with no issues. I can also send PDF files that do
> not have bmp logos with no issues. I have sent the file to my gmail and
> MSN accounts and the PDF is not readable. The problem is PDF with logos
> (.bmp). The PDF on the Unix box is valid, I can copy it via Samba (or
> ftp) to my Windows box and it is viewable. I have no entries in my
> .muttrc file.

Firstly, does mutt correctly mark the PDF file as application/pdf ? If so,
it looks like it's got the MIME-type right, but there's no data in there
which requires binary encoding, so it's using QP. (Is this the encoding you
see?)

This would be easier for people to reproduce if we had a sample PDF file
which caused the problem. Could you upload a copy somewhere people can get
it? At least way we might be able to verify whether it's a mutt encoding
error or a decode error by the other client.

For what it's worth, I've just tried with random PDF files, and they both
came out as "application/pdf, base64". I know one of them has images in. BMP
images in general tend to have binary data in, so it's weird that they would
be triggering this.

--
Paul

Interviewer: Well, can you... blow up the world?
Tick: Egad. I hope not. That's where I keep all my stuff.

Gary Quiring

unread,
Sep 27, 2005, 6:45:25 PM9/27/05
to

I emailed the PDF file to Tim, he had no issues sending it on his BSD
box with mutt 1.5. I am running 1.4 and still cannot get a clean
compile using 1.5. Since I was able to send PDF using mutt on my old
SCO box I know my mail server/client is not the cause. At this point
I have assume it's 1.4 or Solaris. If you want the PDF just send me
an email to gqui...@msn.com

Thanks
Gary

Message has been deleted

Gary Quiring

unread,
Sep 27, 2005, 7:27:24 PM9/27/05
to
Success!!! I finally got mutt 1.5 to compile. The configure script
incorrectly configures ncurses for Solaris. I found the post on a
Yahoo forum on the issue.

With mutt 1.5 running the PDF file is no longer corrupted.

Thanks all for the help (EXCEPT ALAN - get a life)

Gary Quiring

Tim Hammerquist

unread,
Sep 28, 2005, 3:06:47 AM9/28/05
to
Gary Quiring <gqui...@msn.com> wrote:

I'm glad Gary got this sorted out, but just fyi (for future
archive searches:
- I fetched Gary's sample pdf document off a web server.
- I verified that it worked on the downloading system without
BMP garbling. It worked.
- I transfered the file to another host via scp and verified
that it worked on that machine. It did.
- On the original downloading system (OpenBSD 3.7) I used
mutt's (v1.5.8i) to attach the document to an email. Mutt
correctly set the mime type as application/pdf, and used
quoted-printable method.
- Sent the resulting email and attachment to an IMAP account
where I fetched it via several different MUAs (though none
of them were Outlook.... nor even Windows systems). All
worked.

Glad to hear that the upgrade to v1.5 worked for you, Gary!

Mutt's a damn good dog, ain't he? (she?)

Cheers,
Tim Hammerquist

Paul Walker

unread,
Sep 28, 2005, 4:42:27 AM9/28/05
to
On Tue, 27 Sep 2005 19:27:24 -0400, Gary Quiring wrote:

> Success!!! I finally got mutt 1.5 to compile. The configure script
> incorrectly configures ncurses for Solaris. I found the post on a
> Yahoo forum on the issue.

Ah, that's good. For people who are reading back through the archives, could
you post a link to the post which sorted you out?

Also, if it's a configure bug, could you submit it to the bug database so it
can be fixed? I think there should be a link from www.mutt.org

> Thanks all for the help (EXCEPT ALAN - get a life)

http://www.pearlgates.net/nanae/kooks/alanconnor.shtml is informative.

--
Paul

And if you really want to hide ASCII text, put it in a file called README.
If my experience of users is at all representative, this security measure is
99.99% effective. -- Richard Heathfield

Gary Quiring

unread,
Sep 28, 2005, 7:41:46 AM9/28/05
to
On Wed, 28 Sep 2005 08:42:27 +0000 (UTC), Paul Walker <use...@blacksun.org.uk>
wrote:

>On Tue, 27 Sep 2005 19:27:24 -0400, Gary Quiring wrote:


>
>> Success!!! I finally got mutt 1.5 to compile. The configure script
>> incorrectly configures ncurses for Solaris. I found the post on a
>> Yahoo forum on the issue.
>
>Ah, that's good. For people who are reading back through the archives, could
>you post a link to the post which sorted you out?

I changed the Makefile:
#MUTTLIBS = -lncurses
MUTTLIBS = -lcurses

This was the thread that clued me in:
http://groups.yahoo.com/group/mutt-dev/message/18150


>Also, if it's a configure bug, could you submit it to the bug database so it
>can be fixed? I think there should be a link from www.mutt.org

I made the report last night. I am not sure they are too interested in fixing
it. From what I read the problem has existed since 2003.

>> Thanks all for the help (EXCEPT ALAN - get a life)
>
>http://www.pearlgates.net/nanae/kooks/alanconnor.shtml is informative.

WOW. What a great read. Good to know it was not 'me'. I am going to make that
a favorite, it's worth keeping.

Thanks
Gary Quiring


Par

unread,
Oct 10, 2005, 2:25:41 PM10/10/05
to
Gary Quiring <gqui...@msn.com>:

> You guys are a bunch of yo-yo's. I guess UNIX cron jobs never factored into
> your brain waves. I have to invoice our dealers. A root cron job sends the
> email. Do you really think I want my customers seeing ro...@server.company.com?
> I change the email to an email they can respond to.

Why on earth are you running it as root? Just write a nice
(Perl/sed/awk/whatever) script that creates the proper mail, including a
reasonable header, and chuck it into your MTA directly. Why use a MUA?

/Par

--
Par use...@hunter-gatherer.org
"Our company name changes so often we have to use plain mugs and PostIt notes"
-- Simon Burr

0 new messages