#19895Firewall deletes attachments
Description
When sending emails with doc or pdf files as attachment, some firewalls remove this attachment because it isn’t correctly marked.
Solution:
File “t3lib/class.t3lib_formmail.php”:
function addAttachment($file, $filename) {
$content = $this->getURL($file); // We fetch the content and the mime-type
$fileInfo = $this->split_fileref($filename);
if ($fileInfo[‘fileext’] 'gif') {$content_type = 'image/gif';}
if ($fileInfo['fileext'] ‘bmp’) {$content_type = ‘image/bmp’;}
if ($fileInfo[‘fileext’] 'jpg' || $fileInfo['fileext'] ‘jpeg’) {$content_type = ‘image/jpeg’;}
if ($fileInfo[‘fileext’] 'html' || $fileInfo['fileext'] ‘htm’) {$content_type = ‘text/html’;}
+ if ($fileInfo[‘fileext’] 'doc') {$content_type = 'application/msword';}
+ if ($fileInfo['fileext'] ‘pdf’) {$content_type = ‘application/pdf’;}
if (!$content_type) {$content_type = ‘application/octet-stream’;}
if ($content) {
$theArr[‘content_type’]= $content_type;
$theArr[‘content’]= $content;
$theArr[‘filename’]= $filename;
$this->theParts[‘attach’][]=$theArr;
return true;
} else { return false;}
}
(issue imported from #M10239)Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.