User our mime_type primitive for attaching files.

  Rather than adding attachments as application/octet-stream.
  BUGFIX:  The mime_type parsing is improved.

  Previously we'd parse /etc/mime_types, but not tokenize in the
 case of multiple matches.  This would lead to image/jpg being
 stored in our table with the suffix:
        jpg jpeg jpe

  We now tokenize so that:

        mime[jpg]  -> image/jpg
        mime[jpeg] -> image/jpg
        mime[jpe]  -> image/jpg

  This is the expected result.  (Spotted after updating the
 attachment handling to use the correct type.)