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

Joshua Swink joshua.swink at gmail.com
Thu Jul 1 16:26:05 PDT 2010


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


More information about the sakai-dev mailing list