Request: Truncate long filenames based off email subjects

Today I was trying to package up and compress an entire DEVONthink database. This particular database has nothing but years of archived emails. DTPO writes each email as an individual file in the filesystem and uses the email subject as the file name. The maximum length for an HFS file name is 255 characters. When an email subject is longer than 250 characters it gets truncated at 250 and then the “.eml” extension is added for a 254 character name. So far so good.

The problem is that these files have extended attributes. tar, ditto, and zip all save and extract the extended attributes as if it were a separate file of the same name prefixed with “._” and suffixed with “__”. That means the name of the extended attributes file is four characters longer than the name of the real file which pushes it beyond 255 characters and the restore fails. The end result is that the file and its data fork are restored but the extended attributes are lost. BTW, compressing/decompressing with Finder has the same problem except that it happens silently without any warning.

So, my request is that you truncate email subjects at 246 characters instead of 250 so that extended attributes won’t be lost when packaging/compressing databases outside of DEVONthink.

As a follow on question, what is the effect of removing the extended attributes of an eml file inside DTPO and is there anything I should to to rebuild them?

Thank you for the request, the next release will improve this.

Were the .eml files created by DEVONthink Pro Office? Then the extended attributes are usually just some internal ones created while archiving emails and therefore not important.