Fix erroneous email when folders are shared

itemType is never "dir"; it's either "file" or "folder".
I release this patch under the MIT license.