Subject: Reading attachments with external program

From: Mats Dufberg <[email-masked]>
Date: Fri, 8 Aug 2003 17:30:22 +0200 (CEST)

How do I configure pine (under unix) so that I can read an attachment with
an external program? I'd like to be able to open PDF attachments with xpdf
and MS-WORD files with antiword without having to extract the files.

Mats

-----------------------------------------------------------------
Mats Dufberg                                      [email-masked]
Blaoarvsgraend 42                                  +46-8-38 48 59
SE-162 45 Vaellingby, Sweden                      +46-70-258 2588
-- 
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------

---

From: Gopi Sundaram <[email-masked]>
Date: Fri, 8 Aug 2003 10:41:18 -0500 (CDT)

On Fri, 8 Aug 2003, Mats Dufberg wrote:

> an external program?

Make sure that the MIME-type of the attachment is correct, and add the
application to handle it in your mailcap file. You may want to add an
entry to your mime.types file to identify extensions with MIME-types.

-- 
Gopi Sundaram
http://www.zrox.net/Mail/Pine/

---

From: Birl <[email-masked]>
Date: Fri, 8 Aug 2003 13:06:58 -0400 (EDT)

As it was written on Aug 8, thus Gopi Sundaram spake unto Pine Discussion Forum:

Gopi:  Date: Fri, 8 Aug 2003 10:41:18 -0500 (CDT)
Gopi:  From: Gopi Sundaram <[email-masked]>
Gopi:  To: Pine Discussion Forum <[email-masked]>
Gopi:  Subject: Re: Reading attachments with external program
Gopi:
Gopi:  On Fri, 8 Aug 2003, Mats Dufberg wrote:
Gopi:
Gopi:  > How do I configure pine (under unix) so that I can read an attachment with
Gopi:  > an external program?
Gopi:
Gopi:  Make sure that the MIME-type of the attachment is correct, and add the
Gopi:  application to handle it in your mailcap file. You may want to add an
Gopi:  entry to your mime.types file to identify extensions with MIME-types.
Gopi:
Gopi:  --
Gopi:  Gopi Sundaram
Gopi:  http://www.zrox.net/Mail/Pine/

That may not be sufficent.  If Mats is running under X (or CDE, etc),
2 commands might need to be executed:

As root:  xhost + localhost
As user:  setenv DISPLAY :0

In my situation, Im in CDE (under Solaris 9) as root, yet Im checking my
email through a dtterm as my non-privleged self.

My non-privleged account uses Netscape to view URLs and image attachments,
but without those 2 commands, Netscape will not attach to root's CDE
screen.

Just something to think about.

---

From: Alexander V Alekseev <[email-masked]>
Date: Fri, 8 Aug 2003 21:13:50 +0400 (MSD)

Hello!

> As root:  xhost + localhost
	It seems to be much secure to copy ~/.Xauthority from root
to non-priviledged user.

> As user:  setenv DISPLAY :0

	Bye. Alex.

---

From: Gopi Sundaram <[email-masked]>
Date: Fri, 8 Aug 2003 13:32:43 -0500 (CDT)

>> 2 commands might need to be executed:
<snip>

That refers only to when your Pine session is running under different
privileges than your X session.

> It seems to be much secure to copy ~/.Xauthority from root to
> non-priviledged user.

Many Unix flavors support setting the XAUTHORITY env var to the path to
the .Xauthority file you want to use.

---

From: Alexander V Alekseev <[email-masked]>
Date: Fri, 8 Aug 2003 22:45:06 +0400 (MSD)

Hello!

> the .Xauthority file you want to use.
	You're right. But that works only if you need to start X
applications under only one user, other than root. (Because file must not
be readable by users other than root and the user we expect to. That's
why, we have to "chown our_user ~root/.Xauthority" to let it work,
and also give all(or only that one) users access to the directory with
it. Really, it's usually much more difficult to do, than just copy file.)

		Bye. Alex.

PS: It's seems to be off-topic ;-))

---

From: Mats Dufberg <[email-masked]>
Date: Fri, 8 Aug 2003 23:19:56 +0200 (CEST)

> entry to your mime.types file to identify extensions with MIME-types.

I've added the following lines to .mailcap,

  Application/MSWORD;/usr/local/bin/antiword %s
  Application/PDF;/usr/X11R6/bin/xpdf %s

When I try a PDF attachment, it works as expected, but for MSWORD
attachment, something seems to happen in the background, but it is not
shown to me. Do I have to open an xterm window in some way?

Mats

---

From: Gopi Sundaram <[email-masked]>
Date: Sat, 9 Aug 2003 01:04:38 -0500 (CDT)

> shown to me. Do I have to open an xterm window in some way?

I've never used antiword, so I don't know.

Try writing a wrapper script around antiword and using that as the
application for word attachments.

Put a sleep at the end of the wrapper script, so you have time to see
what happens before it ends.