[Building Sakai] Thunderbird puts mime type application/applefile; mailarchive discards attachment

Joshua Swink joshua.swink at gmail.com
Fri Jul 2 11:43:55 PDT 2010


Great, I created http://jira.sakaiproject.org/browse/SAK-18738. If
there's anything else I can do please let me know. I don't have any
example files that can be publicly shared, unfortunately, but if I
come across any I will attach one to the ticket.

Josh

On Thu, Jul 1, 2010 at 8:18 PM, Matthew Jones <jonespm at umich.edu> wrote:
> I think option 3 as mentioned is the best, it shouldn't trust the browser
> (or email client) if it's providing incorrect information, and the detection
> libraries are pretty good.
> Sakai doesn't currently contain any thing like this but it reminds me that I
> had planned to work on the related item KNL-101/SAK-18032 which would use
> the mime-util library to detect the file type. However I was waiting for
> Stephen Marquard to finish KNL-325 and forgot about it. (Or was waiting for
> someone else to do it first)
> If you file this/assign it to me [ or implement it :) ], I'll put it near
> the top of my todo list before 2.8, as they should all be pretty easy to fix
> now. It should be able to be back ported to 2.7.x, but unlikely anything
> earlier.
> -Matthew
> On Thu, Jul 1, 2010 at 7:26 PM, Joshua Swink <joshua.swink at gmail.com> wrote:
>>
>> We're having a problem with the mail archive quietly discarding
>> message attachments. This starts with the user's email client.
>> Thunderbird will frequently, and improperly, assign a MIME type of
>> "application/applefile" to various attachments, such as Word documents
>> and PDFs. The Sakai mail archive will therefore silently discard the
>> attachment before forwarding the message.
>>
>> The mail archive does it with the following code in SakaiMailet.java
>>
>>                // Discard parts with mime-type application/applefile. If
>> an e-mail
>> message contains an attachment is sent from
>>                // a macintosh, you may get two parts, one for the data
>> fork and one
>> for the resource fork. The part that
>>                // corresponds to the resource fork confuses users, this
>> has
>> mime-type application/applefile. The best thing
>>                // is to discard it.
>>                else if (p.isMimeType("application/applefile"))
>>                {
>>                        M_log.warn(this+" message with
>> application/applefile discarded");
>>                }
>>
>> A quick look at the current trunk shows that this is still the case:
>>
>>
>> https://source.sakaiproject.org/svn/mailarchive/trunk/mailarchive-james/james/src/java/org/sakaiproject/james/SakaiMailet.java
>>
>> I need to find a way for the attachments to go through. Options include:
>>
>> -- Stop discarding application/applefile attachments. This would
>> surely allow the desired attachments through, though it would also
>> allow resource forks through, which I don't particularly want.
>> -- Stop discarding application/applefile attachments under some set of
>> arbitrary conditions. Such as: the user-agent contains "Thunderbird",
>> or the attachment name contains ".doc" or ".pdf". This is very hacky
>> and would provide only a partial, short-lived, and messy solution.
>> -- Whenever an attachment has the MIME type application/applefile, get
>> a second opinion from some software on the server. If this results in
>> some other type than application/applefile, allow the attachment to
>> stay. This would be very nice, if the software is already in Sakai and
>> is readily accessible.
>>
>> Questions. Are there any better ideas? Does Sakai contain software
>> that could be used to analyze attachments to determine their MIME
>> types?
>>
>> Thanks for any assistance.
>>
>> --
>> Joshua Swink
>> UC Merced Enterprise Web Applications
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>
>> TO UNSUBSCRIBE: send email to
>> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>> "unsubscribe"
>
>


More information about the sakai-dev mailing list