Add support for specifying the mime type when attaching files.

Also added the *mime* setting which is the default MIME type used when
it was not possible to determine the MIME type of a file.