Okay I have a ("dirty") fix for inline attachments sent using Outlook Express. This only applies for those that let osTicket fetch mail via IMAP or POP3:
Replace the saveAttachments function within class.mailfetch.php with this one:
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 for that crappy Outlook Express (and others?) that ignore Content-Disposition :(
elseif ($part && $part->ifparameters && $part->type == 5 && $part->encoding == 3) {
$filename = 'Attachment_'.$index;
// Lets get the right attachment name
foreach ($part->parameters as $parameter) {
if (strtoupper($parameter->attribute) == 'NAME') {
$filename = $parameter->value;
}
}
// Quote: do some maginc
$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));
}
}
}This works for me, it might just work for you too :)
UPDATE
I've updated the function because it didn't catch the right name from inline attachments sent with Incredimail (let's face it, people who are using incredimail also need support )