KAZOO-2875: handle attachments by extension if required (submitted by Sergey Korobkov)