PH

« Home

Access Mutt attachments remotely (SSH)

Mutt is hard to adopt, once-you-learn-you-love-it, and very flexible email clients. Through remote (e.g. SSH) connections is time-consuming to open the attachments. It needs to save and download the attachment to remote host. One way to get around this is to serve the attachment through a webserver on a specific port and open up the browser on the remote host to view the attachment on that port. This can be easily done by a simple bash script and using netcat. Below is the script that you need to save in your home directory (e.g. ~/bin/muttattach.sh).

Make it executable (e.g. chmod +x muttattach.sh). Modify ~/.mutt/mailcap and the following lines:

text/; ~/bin/muttattch.sh %s
application/; ~/bin/muttattch.sh %s
image/; ~/bin/muttattch.sh %s
audio/; ~/bin/muttattch.sh %s
 
Now open up an attachment in mutt, browse to http://localhost:8083 on remote host.
the above script is the modified version of http://www.linuxjournal.com/article/6511