Skip Navigation

File attachments

MIME

There is one standard technique for sending multimedia through email, it's called MIME and mutt supports both sending and receiving it. MIME is an acronym for Multipurpose Internet Mail Extensions; you should read a MIME overview if you are interested in how it works and why it came to exist.

~/.mailcap

Mutt, like many other mime aware tools, refers to the mailcap configuration file for instructions on viewing different types of mime-encoded mail attachments.

There are two likely locations for your mailcap file; /etc/mailcap for system-wide settings and ~/.mailcap where you should add entries you create or modify as a normal user - Full instructions for configuring your mailcap file can be found in the MIME section of the mutt manual.

Viewing file attachments in mutt

Mutt has the ability to view any attachment inline in the pager - As long as you have an appropriate tool that can convert the attachment to plain text.

Specify which mime-types you want to view inline with the auto_view command. Microsoft word documents, rich-text files, html email and even images (with some loss in quality) can be viewed in this way - You might want refer to some specific instructions for handling MIME attachments.

Fixing broken Content-Type:

A common problem, particularly with mailers from the windows world that rely on file-extensions for identifying content-types, is that many attachments are mis-labelled as the generic Content-Type: octet/stream.

You can temporarily fix the content-type of a mime part using the edit-type command, bound to Ctrl-e in the attach menu. This can get tedious if you receive lots of octet/stream attachments - If so, then you may want to install mutt octet filter, a tool that tries to identify the real content-type of attachments.

~/.mime.types

When mutt attaches a file to a new email, it tries to guess the appropriate content-type label using the mime.types file. The system mime.types file can normally be found at /etc/mime.types. If you find that you need to add entries to mime.types, add them to a ~/.mime.types file in your home directory.

When mutt is viewing a message, it will try to show everything inline that it knows it can represent as text. Other graphical mailers like netscape messenger respect the Content-Disposition: inline mime header and will only show an attachment inline if this header exists. By default mutt will label all non-text attachments and images as Content-Disposition: attachment - You can change this setting for each attachment using the toggle-disposition command, bound to Crtl-d by default

Viruses, worms and security

If you think that using mutt and a unix-variant makes you immune to the virus and worm problems experienced by the Windows world, then you are certainly mistaken. Mutt does it's best not to allow messages, which should be considered tainted, to become executable. However, there are many other potential weak points in any system - Your mailcap or procmail settings may route attachments via tools that were never designed to handle corrupt or malicious data, or there may security issues with other tools that were.

<< | Up | >>

This document was last modified on 2012-02-28 21:26:12.
Bruno Postle <bruno@postle.net>
Copyright © 2001 Bruno Postle and others. This guide is released under the Free Documentation License. http://www.gnu.org/licenses/fdl.txt