Hi guysI am receiving file import errors every now and then.  I've noticed a trend for the majority of emails.  The scenario is that whenever the attachment is an email message (email.eml) that contains an attachment (attach.pdf), the body of the attached email (email.eml) is added to the ticket thread and the attachment (attach.pdf) is not imported and the ticket thread says "SYSTEM - File Import Error" "attach.pdf:  Unable to save file".This tends to happen at least once a day.I am running osTicket v1.10.1 on Ubuntu 14.04 LTS.  php version is 5.6.  I use IMAP to import emails and use the attachment plugin to save to the file system.Any help would be much appreciated.

This has been reported a few times but only appears to happen when a user uses Outlook to attach .eml files with attachments embeded in them.  I would recommend training people not to do that. 

It is very difficult as our emails come in from many different external parties.  We can't train them unfortunately.  Is this something that will be looked at in future?

I'm not aware of, but I'll ask.

5 days later

Thank you. That would be much appreciated.

14 days later

If you follow these instructions it will work.https://github.com/osTicket/osTicket/pull/3418/commits/e04d0401f42c0d2e6b785f6cbb92c29c32f870a5

Thanks @[deleted], I wish I'd spotted that before - I was up til the small hours last night doing a similar patch :)The problem is caused by the fact that mail fetcher skips the attached message because it has no name (understandably), so ends up skipping the attachment altogether.  If the attachment has a named attachment in itself, like an image, the structure walk finds that and notes its name and mime type.  Unfortunately, when it comes to add the body content, it then finds the content of your attached message.  So you end up with an attachment called maybe image001.png, type image/png, but the content of it is "<html>... your attached message ... </html>".  All a bit screwy.The solution is to treat the rfc822 attachment as a first class citizen regardless of being unnamed, not recurse, and give it a name with a .eml extension.  Then it adds the attachment which you can click on and it should open in your mail client, certainly works with Outlook.

25 days later

Hi @[deleted]  Thanks for the advice.  The attachments do have filenames though?  Or does this solve the same problem?@[deleted] - is this something that will be merged in future?Thanks all!

3 months later

For me just resolved evrything and the attachments are working as they should.

Write a Reply...