Mutt Over SSH, but What About Attachments?

From the rejection files of Linux Journal, a suggestion for handling attachments in a remote Mutt session.
______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Mutt over SSH: just pipe the attachments

Anonymous's picture

Here's what I do:

I just pipe the attachment directly to a file on my client, using ssh.

In Mutt, I select the attachment and then press the pipe keystroke, which is logically "|". Then:

ssh client 'cat >Desktop/my_attach.jpg'.

This has no setup unlike the other methods. It means you save writing out the attachment as a temp file on the server. However, you still have up the temp files on the client. That would be easily solved by writing them first a tmp directory, which was cleaned out a cron script.

Maybe a slick helper script could generate this syntax, replacing 'my_attach.jpg' with the actual file name of the attachment.

This works great - Thanx for

Anonymous's picture

This works great - Thanx for this tip. BUT unfortunately I can't use this as my desktop doesn't have public IP :-(

Re: Mutt Over SSH, but What About Attachments?

Anonymous's picture

Funny this should come up, I had just put together basically the same system for myself. The scripts i wrote are at http://people.internet2.edu/~danno/mozilla-stuff/

I did one different thing. rather than setting up an ssh tunnel for the file transfer, i copy attachments to my public_html directory, wait 5 seconds for the moz-remote client to do its thing, and delete the file from public_html. This is riskier than the ssh forwarding to localhost way, but was simpler to set up.

Obviously my approach only works if i have personal web space on the same server.

I'd really like to figure out a way to extend this to work when i am stuck sitting at a windows machine. The best idea i have come up with so far is to run cygwin and an sshd there, and scp the files back, like you mention above. I don't like this much; i'd really like to find something that is not real intrusive.

Maybe extending puTTY to accept a special escape sequence...hmm.

One thought about the need to "control" the mail server. The issue of control is different than the issue of trust, and what is important here is trust. Also, this system does not add any additional risk beyond what probably already have - your mail is already going to this server, and you probably already ssh-tunnelling X11 to it.

I tried something simlar a few years ago and netscape -remote was pretty awful over a medium-speed WAN connection. I seem to recall lots of xevents querying each window id on my X server. I haven't tried this thing over a slow connection yet but it probably hasn't changed.

i'm danpritts at ya hoo.

Re: Mutt Over SSH, but What About Attachments?

Anonymous's picture

well, the putty idea led me to look at putty's web site looking for it and they have heard this idea already (big surprise) and don't like it for security reasons (also big surprise).

they have a solution, though it is a little more heavyweight: DoIt

Re: Mutt Over SSH, but What About Attachments?

Anonymous's picture

Your idea is quite ok, but it maybe more comfortable

to open attachments (specifically office documents)

directly in Office Suite.

Once upon a time I've discovered that StarOffice

has kind of API which can be used over the network.

I haven't checked but I suppose it would be also

supported in the OpenOffice.

Check out: http://czarnobyl.pik-net.pl/openinso/

Re: Mutt Over SSH, but What About Attachments?

pdxmph's picture

How about installing imapd on the remote server, since it's one you "control and trust." Then you can tunnel IMAP from your local system back to the remote using the functionality mutt provides to do just that:

Here's a wiki entry describing it, or there's always the guide that's been around forever on SourceForge.

Re: Mutt Over SSH, but What About Attachments?

dmarti's picture

IMAP support in mutt is heinously slow. I tried getting to my server with IMAP for several months but it's so much faster, especially with the very large mailboxes I need to search, just to ssh in.

Re: Mutt Over SSH, but What About Attachments?

Anonymous's picture

Yeah, I've had the same issue (with Cyrus as the server); mutt's about 100-200 times slower than KMail opening a mailbox with a thousand messages. I'm gonna try comparing their IMAP code sometime.

Re: Mutt Over SSH, but What About Attachments?

pdxmph's picture

IMAP support in mutt is heinously slow.

It seemed so to me, as well. Then I applied a fix I found in the SquirrelMail archives when I faced similar performance with that client . Applies to UW IMAP, btw:

http://www.squirrelmail.org/wiki/en_US/SpeedWithUW