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

Viewing ".pdf attachments" in mutt

703 views
Skip to first unread message

Felix Karpfen

unread,
Nov 28, 2007, 4:01:33 PM11/28/07
to
At present, .pdf attachments to emails are picked up by my "octet-filter"
plugin and give output such as the following:

| [-- mutt.octet.filter file type: "PDF document, version 1.4" --]
|
| [-- Statistics (lines words chars): 219 482 10750 /home/felixk/.tmp/tmp368E.pdf
| +--]
|
| %PDF-1.4
| %\342\343
| 10 0 obj
| <<
| /Length 2926
| /Filter /FlateDecode
| >>
| stream
| xM-^\M--ZIwM-[F^RM->M-{WM-`M-`^CM-^UgM-BM-=/9^M%A63
| M-)PM-^LM-^W7M-I^AM-&`^YM-O\^TM-^RJM-b^??M-UM-
|
| Remainder snipped

Is it possible (via a mailcap entry?) to view the content from within
"mutt"? And, if so, are there any security hazards of which I should be
aware?

All advice will be gratefully received.


Felix Karpfen

--
Felix Karpfen
Public Key 72FDF9DF (DH/DSA)

Christian Ebert

unread,
Nov 28, 2007, 6:51:55 PM11/28/07
to
* Felix Karpfen on Wednesday, November 28, 2007:

> At present, .pdf attachments to emails are picked up by my "octet-filter"
> plugin and give output such as the following:

<snip>



> Is it possible (via a mailcap entry?) to view the content from within
> "mutt"?

$ grep -F pdf ~/.mailcap
application/pdf; xapp.sh xpdf /dev/stdin
application/pdf; pdftotext -layout /dev/stdin -; copiousoutput

> And, if so, are there any security hazards of which I should be
> aware?

I don't know.

c
--
Python Mutt utilities <http://www.blacktrash.org/hg/muttils/>

Felix Karpfen

unread,
Nov 30, 2007, 4:03:36 PM11/30/07
to
On Thu, 29 Nov 2007 00:51:55 +0100, Christian Ebert wrote:

>
> $ grep -F pdf ~/.mailcap*


> application/pdf; xapp.sh xpdf /dev/stdin
> application/pdf; pdftotext -layout /dev/stdin -; copiousoutput
>


Thank you for the advice.

Regrettably, my query was too brief and omitted vital info.

I believe that my entries in ".mailcap" could handle "application/pdf"
attachments. The output of "grep -F pdf ~/.mailcap" reads:

| $ grep -F pdf ~/.mailcap

| application/pdf; kpdf %s
| text/x-pdf;;\

It balks at the following headers:

| Content-Type: application/octet-stream;
| name="tmp368E.pdf"
| Content-Transfer-Encoding: base64
| Content-Disposition: attachment;
| filename="tmp368E.pdf"

The "mutt.octet.filter" plugin can handle the header, but the output is
unhelpful.


Felix

s. keeling

unread,
Dec 1, 2007, 12:48:37 PM12/1/07
to
Christian Ebert <black...@gmx.net>:

>
> $ grep -F pdf ~/.mailcap
> application/pdf; xapp.sh xpdf /dev/stdin

What's xapp.sh?

> application/pdf; pdftotext -layout /dev/stdin -; copiousoutput


--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://blinkynet.net/comp/uip5.html Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.

Christian Ebert

unread,
Dec 1, 2007, 5:58:57 PM12/1/07
to
* s. keeling on Saturday, December 01, 2007:

> Christian Ebert <black...@gmx.net>:
>> $ grep -F pdf ~/.mailcap
>> application/pdf; xapp.sh xpdf /dev/stdin
>
> What's xapp.sh?

Sorry that slipped in. Idiosyncratic script here -- customized
version of Apple's "open-x11". You can just ignore it.

Christian Ebert

unread,
Dec 1, 2007, 6:03:13 PM12/1/07
to
* Felix Karpfen on Friday, November 30, 2007:

> I believe that my entries in ".mailcap" could handle "application/pdf"
> attachments. The output of "grep -F pdf ~/.mailcap" reads:
>
>| $ grep -F pdf ~/.mailcap
>| application/pdf; kpdf %s
>| text/x-pdf;;\
>
> It balks at the following headers:
>
>| Content-Type: application/octet-stream;
>| name="tmp368E.pdf"
>| Content-Transfer-Encoding: base64
>| Content-Disposition: attachment;
>| filename="tmp368E.pdf"
>
> The "mutt.octet.filter" plugin can handle the header, but the output is
> unhelpful.

Nice script; I used it for quite some time, but

mime_lookup application/octet-stream

in your muttrc is way cooler ;-)

Apart from that I don't know what could be your issue. Have you
tried and saved the pdf, and then opened it? Is the pdf perhaps
damaged? Does octet.filter work correctly on other pdfs?

Felix Karpfen

unread,
Dec 2, 2007, 3:52:10 PM12/2/07
to
On Sun, 02 Dec 2007 00:03:13 +0100, Christian Ebert wrote:

>>
>> The "mutt.octet.filter" plugin can handle the header, but the output is
>> unhelpful.
>
> Nice script; I used it for quite some time, but
>
> mime_lookup application/octet-stream
>

Thank you. I will check that out.


> in your muttrc is way cooler ;-)
>
> Apart from that I don't know what could be your issue. Have you
> tried and saved the pdf, and then opened it?
>

That works without problems.

Hence the query is just a niggle. If it has no obvious answer, please
don't waste any further time on it.


> Does octet.filter work correctly on other pdfs?
>

Don't know!

If the header identifies the attachment as "application/pdf" (the
normal situation with .pdf attachments) then the current entry in my
.mailcap file displays the content.

0 new messages