#3739: mutt_lookup_mime_type() finds name if len(name)==len(extension)
-----------------------------------+----------------------
 Reporter:  sdaoden                |      Owner:  mutt-dev
     Type:  defect                 |     Status:  new
 Priority:  major                  |  Milestone:
Component:  MIME                   |    Version:  1.5.23
 Keywords:  mutt_lookup_mime_type  |
-----------------------------------+----------------------
 Any filename that equals an extension in mime.types will cause
 mutt_lookup_mime_type() to falsely use the corresponding MIME type.
 It would be a (cough :---)) feature but it only works for relative
 filenames, not for absolute ones:

 {{{
         /* cycle through the file extensions */
         while ((p = strtok (p, " \t\n")))
         {
           sze = mutt_strlen (p);
           if ((sze > cur_sze) && (szf >= sze) &&
               (mutt_strcasecmp (path + szf - sze, p) == 0 ||
 ascii_strcasecmp (path + szf - sze, p) == 0) &&
               (szf == sze || path[szf - sze - 1] == '.'))
           {
             /* get the content-type */
 }}}

 E.g.

 {{{
   $ echo bla|mutt -s test -a mov -x XX
 ->
   Content-Type: video/quicktime
   Content-Disposition: attachment; filename=mov
   Content-Transfer-Encoding: quoted-printable
 }}}

 But

 {{{
   $  echo bla|mutt -s test -a ./mov -x XX
 ->
   Content-Type: text/plain; charset=utf-8
   Content-Disposition: attachment; filename=mov
 }}}

 P.S.: mysteriously my beloved account cannot be accessed anymore, even
 after password reset.  I had to create a new one.  :-)

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/3739>
Mutt <http://www.mutt.org/>
The Mutt mail user agent

Reply via email to