This MOD also allow to receive mail in html with image ?
i have a problem when the client open a ticket via e-mail and attach an immage (screen shot) in the test to explain his problem.
In this case in the ticket the image is lost.
thanks
osTicket the screen shot or screendump feature does not work when a ticket is sent in, so if a user is emailing in and they paste a screenshot into the email, it does not get sent with the ticket. Amending a couple of files will allow them to start working:
pipe.php
Find:
if($filename && $cfg->canUploadFileType($filename)) {
$ticket->saveAttachment($filename,$part->body,$msgid,'M');
}
Just after add:
//Allow embedded images from Outlook
} elseif (!($part->disposition)
&& (!strcasecmp($part->ctype_primary,'image')) ) {
$filename=$part->ctype_parameters;
if($filename && $cfg->canUploadFileType($filename)) {
$ticket->saveAttachment($filename,$part->body,$msgid,'M');
}
class.mailfetch.php
Find:
function saveAttachments($ticket,$mid,$part,$index=0) {
global $cfg;
if($part && $part->ifdparameters && ($filename=$part->dparameters->value)){ //attachment
$index=$index?$index;
if($ticket && $cfg->canUploadFileType($filename) && $cfg->getMaxFileSize()>=$part->bytes) {
//extract the attachments...and do the magic.
$data=$this->decode($part->encoding, imap_fetchbody($this->mbox,$mid,$index));
$ticket->saveAttachment($filename,$data,$ticket->getLastMsgId(),'M');
return;
}
//TODO: Log failure??
}
//Recursive attachment search!
if($part && $part->parts) {
foreach($part->parts as $k=>$struct) {
if($index) $prefix = $index.'.';
$this->saveAttachments($ticket,$mid,$struct,$prefix.($k+1));
}
}
}
Replace it with:
function saveAttachments($ticket,$mid,$part,$index=0) {
global $cfg;
// Default disposition attachments
if($part && $part->ifdparameters && ($filename=$part->dparameters->value)){ //attachment
$index=$index?$index;
if($ticket && $cfg->canUploadFileType($filename) && $cfg->getMaxFileSize()>=$part->bytes) {
//extract the attachments...and do the magic.
$data=$this->decode($part->encoding, imap_fetchbody($this->mbox,$mid,$index));
$ticket->saveAttachment($filename,$data,$ticket->getLastMsgId(),'M');
return;
}
//TODO: Log failure??
}
// Bugfix elseif ($part && $part->ifparameters && $part->type == 5 && $part->encoding == 3) {
$filename = 'Attachment_'.$index;
// Attachment name
foreach ($part->parameters as $parameter) {
if (strtoupper($parameter->attribute) == 'NAME') {
$filename = $parameter->value;
}
}
// Change
$data = $this->decode($part->encoding, imap_fetchbody($this->mbox,$mid,$index));
$ticket->saveAttachment($filename,$data,$ticket->getLastMsgId(),'M');
return;
}
//Recursive attachment search!
if($part && $part->parts) {
foreach($part->parts as $k=>$struct) {
if($index) $prefix = $index.'.';
$this->saveAttachments($ticket,$mid,$struct,$prefix.($k+1));
}
}
}