Attachment-viewing script for mutt

My primary email client for my e-scribe mail is mutt. This came about in an almost accidental way.

Last summer I moved all my websites and mail to a new server. As I was setting it up I realized that I had an opportunity to decide that no passwords for this box would ever be sent in the clear. No telnet and no FTP, that was easy. But given the hassle of setting up encrypted mail authentication, I had in the past let that one slide. So I decided that until I set it up properly, I’d use a terminal-based mail reader over SSH. No unencrypted POP3 or IMAP for me. I looked around and decided mutt looked good.

I never got to the next step. I’ve really enjoyed using mutt thus far and have found it faster and generally less fussy than using a graphical mail client.

However, one big hole in the system until recently was the comparative hassle of dealing with attachments.

My current solution is mutt_save_attachment.py, a simple Python script that works as a helper to save attachments to a directory where you can view them with a web browser. Configuration is explained in the docstring, but basically amounts to 1) adding some lines to .mailcap and 2) setting two environment variables.

I’m sure there are other similar scripts floating around out there. Let me know what you think!


Chas Emerick commented on Fri May 11 03:03:34 2007:

Wow, that’s brave. Your next post is going to be about how to customize gnus, right? ;-)

Actually, I think I remember you mentioning this before. While the mutt implants may have entrenched themselves too deeply, you could try a hosted email service (like http://webmail.us, which is what I use). It’s pretty cheap (especially considering the server maintenance it saves me), and I’ve not had to tunnel SMTP or POP over SSH ever since taking that route.


R Brown commented on Fri May 11 03:17:44 2007:

mutt is excellent. muttzen is always appreciated.


Paul commented on Fri May 11 07:53:55 2007:

Chas – in fact, we do use webmail.us at work (about 40 users) and it has been a big improvement over hosting it ourselves. I use Mail.app there, since we’re an all-Mac operation and it’s hard to beat drag-n-drop for shipping documents around. But naturally I set up mutt (with IMAP support) for myself on the server too!

Despite being a mild emacs-phile, I’ve never tried using it for mail. It’s my $EDITOR though, so much of the time I’m in mutt I’m actually in emacs.


tabo commented on Wed May 16 00:34:01 2007:

Paul, you can use enrcypted communication with your mail server even if it doesn’t support authentication just by using a SSH tunnel. In fact you can use SSH tunnels to secure all your communications.


Paul commented on Wed May 16 07:00:10 2007:

Absolutely true – however, that still fell under the category of “hassle” at the time!


SEO commented on Fri Jun 1 11:52:23 2007:

Thanks for introducing me to Mutz, it seems to be a good solution to my circumstances.

He’s got the plainest looking site i’ve ever seen, but hey i’ve just put aside a couple of hours to give it a shot.

Share: