[9fans] Export local plumber to remote unix host?

2008-08-27 Thread Jon Dugan
Hello,

I read my email on a remote Unix machine which I access from a few terminals
via ssh.  The terminals are also Unix hosts (usually OS X). This works great
for reading text.  However, I frequently receive attachements.  What I'd like
to be able to do is export at least my plumber over the ssh connection to the
remote host so I can display the attachments locally.  This seems to be the
opposite of what import(1) does.  I guess what I want is cpu(1) for
plan9port...  or at least a limited version of it.

This seems like it should be doable, but I think I'm looking at it the wrong
way.

Any suggestions?  (Unfortunately the Unix boxes and Word documents aren't
going away any time soon for me...)

Thanks,

Jon



Re: [9fans] Export local plumber to remote unix host?

2008-08-27 Thread sqweek
On Wed, Aug 27, 2008 at 4:02 PM, Jon Dugan [EMAIL PROTECTED] wrote:
 What I'd like
 to be able to do is export at least my plumber over the ssh connection to the
 remote host so I can display the attachments locally.  This seems to be the
 opposite of what import(1) does.  I guess what I want is cpu(1) for
 plan9port...  or at least a limited version of it.

 Any suggestions?  (Unfortunately the Unix boxes and Word documents aren't
 going away any time soon for me...)

 You have two problems here:
1) Accessing plan 9's plumber from unix
2) Accessing unix files (attachments) from plan 9

 1 isn't too difficult, a listen1 with exportfs -r /mnt/plumb combined
with an ssh port forward (-L or -R, can't remember which applies here)
will give you access to the plumber via p9p's 9p (probably in
combination with srv -a for authentication).
 2 is a little more problematic. It's easy enough to run u9fs over ssh
(see srvssh), but the caveat is when you plumb an attachment like say
/home/jon/mail/foo.doc the plumber running on plan 9 is going to go
/home? wtf is that?. As long as you can devise a convention to get
around that you should be good to go.

 Of course, seems like it might be a bit simpler to run acme Mail.
-sqweek



Re: [9fans] Export local plumber to remote unix host?

2008-08-27 Thread erik quanstrom
  Of course, seems like it might be a bit simpler to run acme Mail.
'
i.e. imap.

- erik




Re: [9fans] Export local plumber to remote unix host?

2008-08-27 Thread sqweek
On Wed, Aug 27, 2008 at 11:57 PM, sqweek [EMAIL PROTECTED] wrote:
 On Wed, Aug 27, 2008 at 4:02 PM, Jon Dugan [EMAIL PROTECTED] wrote:
 What I'd like
 to be able to do is export at least my plumber over the ssh connection to the
 remote host so I can display the attachments locally.

  You have two problems here:
 1) Accessing plan 9's plumber from unix
 2) Accessing unix files (attachments) from plan 9

 Whoops, I missed the note about terminals being unix, and thought
they were plan 9 terminals (funny assumption to make in 9fans, I
know). You'll have to take that as imagine if you were running plan
9, then you could just do this ;)
 I thought Enrico did some work on serving across the network from
p9p, but I don't see anything in hg about it. That will probably be
your main sticking point, problem 2 doesn't change much.
-sqweek



Re: [9fans] Export local plumber to remote unix host?

2008-08-27 Thread a
Let me make sure I understand the problem right: you have p9p
installed on two Unix boxes, A and B. Sitting at A, you ssh to B to
read your mail, and want to be able to plumb (or something
similar) attachments and have applications on A display them.
I presume you're also using non-p9p applications to view the
attachments.

If that's right, the problem is in two parts: having B feed
messages to the plumber on B, and having B find the files
referenced.

You can probably make the terminal mount the server; do so.
How doesn't matter: v9fs, fuse, nfs, afp, whatever. Just get it at,
say, /mnt/B. Make a plumbing rule that checks for files in
/mnt/B (after the normal check for files). You want
arg isfile  /mnt/B/$1
or something very similar in that rule. Now when you plumb
/home/me/attachment1, after not finding that file locally
your plumber will look for /mnt/B/home/me/attachment1.
Have the 'plumb start' bit call open or OpenOffice or whatnot.

For the other part, rather than trying to figure out how to pass
messages around (which is easy if you can mount A from B:
just set $NAMESPACE to /mnt/A/whatever; but you likely
can't do that), just use the local plumber in the first place. For
example, 9term's plumb menu item (like plan9's rio) will
just feed things to a local plumber. If you've set the plumbing
rule up as described above, that's all you need.

(If you're using pine or something that 9term isn't up to, I'm
told there's an rxvt-unicode extension for plumbing, but I
didn't know what rxvt-unicode was before being told that,
so I can't speak any more to it. ask in #plan9 on freenode.)

If, for whatever reason, you need to do something like
!plumb from mail (and can't mount A from B), things are
harder for you. A fake plumber to shuttle bytes to A is
probably doable, but it's likely a lot less work to figure out
how to use a local plumber instead.

Anthony