diff --git a/dev/Common/File.js b/dev/Common/File.js index 532f9ffb22..841554056b 100644 --- a/dev/Common/File.js +++ b/dev/Common/File.js @@ -138,7 +138,7 @@ export const FileInfo = { getContentType: fileName => { fileName = lowerCase(fileName); if ('winmail.dat' === fileName) { - return app + 'ms-tnef'; + return app + 'vnd.ms-tnef'; } let ext = fileName.split('.').pop(); if (/^(txt|text|def|list|in|ini|log|sql|cfg|conf)$/.test(ext)) diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/file/mimetype.php b/snappymail/v/0.0.0/app/libraries/snappymail/file/mimetype.php index e64b57293f..62f1867374 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/file/mimetype.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/file/mimetype.php @@ -103,7 +103,7 @@ public static function fromFilename(string $filename) : ?string { $filename = \strtolower($filename); if ('winmail.dat' === $filename) { - return 'application/ms-tnef'; + return static::$types['tnef']; } $extension = \explode('.', $filename); $extension = \array_pop($extension); @@ -116,7 +116,7 @@ public static function fromFilename(string $filename) : ?string public static function toExtension(string $mime, bool $include_dot = true) : ?string { $mime = \strtolower($mime); - if ('application/pgp-signature' == $mime || 'application/pgp-keys' == $mime) { + if ('application/pgp-signature' === $mime || 'application/pgp-keys' === $mime) { $ext = 'asc'; } else { $mime = \str_replace('application/x-tar', 'application/gtar', $mime); @@ -149,7 +149,6 @@ public static function toExtension(string $mime, bool $include_dot = true) : ?st 'epub' => 'application/epub', 'exe' => 'application/x-msdownload', 'gz' => 'application/gzip', - 'gz' => 'application/x-gzip', 'hlp' => 'application/winhlp', 'js' => 'application/javascript', 'json' => 'application/json', @@ -178,7 +177,9 @@ public static function toExtension(string $mime, bool $include_dot = true) : ?st 'swf' => 'application/x-shockwave-flash', 'tar' => 'application/gtar', // 'tar' => 'application/x-tar', -// 'tgz' => 'application/x-gzip', +// 'tgz' => 'application/gzip', + 'tnef' => 'application/vnd.ms-tnef', +// 'tnef' => 'application/ms-tnef', // not IANA official 'torrent' => 'application/x-bittorrent', 'wgt' => 'application/widget', 'xls' => 'application/vnd.ms-excel', diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php b/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php index f3a124f216..a64c87586e 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php @@ -53,7 +53,7 @@ public function pushHttpHeaders(string $name) : void $name .= '.tgz'; $name = \preg_match('#^[\x01-\x7F]*$#D', $name) ? $name : '=?UTF-8?B?'.\base64_encode($name).'?='; \header("Content-Disposition: attachment; filename={$name}"); - \header("Content-Type: application/x-gzip; name={$name}"); + \header("Content-Type: application/gzip; name={$name}"); } else { $name .= '.tar'; $name = \preg_match('#^[\x01-\x7F]*$#D', $name) ? $name : '=?UTF-8?B?'.\base64_encode($name).'?=';