[[ sendEmail - Content-Type .xlsx ]]

sendEmail - Content-Type .xlsx

CentOS Linux release 7.9.2009 (Core)
sendemail-1.56-1.el7.noarch

При отправке .xlsx файла не верно определяется Content-Type, что может вызвать некоторые ошибки в почтовом клиенте.

Необходимо добавить вручную данный тип файла.

/bin/sendemail

@@ -926,7 +926,6 @@
     elsif ($encoding =~ /exe|bin/i) {                              $content_type = 'application/octet-stream';        }
     elsif ($encoding =~ /ppt|pot|ppa|pps|pwz/i) {                  $content_type = 'application/vnd.ms-powerpoint';   }
     elsif ($encoding =~ /mdb|mda|mde/i) {                          $content_type = 'application/vnd.ms-access';       }
+    elsif ($encoding =~ /xlsx/i)                            {      $content_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';}
     elsif ($encoding =~ /xls|xlt|xlm|xld|xla|xlc|xlw|xll/i) {      $content_type = 'application/vnd.ms-excel';        }
     elsif ($encoding =~ /doc|dot/i) {                              $content_type = 'application/msword';              }
     elsif ($encoding =~ /rtf/i) {                                  $content_type = 'application/rtf';                 }






Обсуждение

Ваш комментарий. Вики-синтаксис разрешён:
168 +1 = 
 
practice/bugs/sendemail_xlsx.txt · Последнее изменение: 2022/08/31 14:53 — 127.0.0.1
Gentoo Linux Gentoo Linux Driven by DokuWiki