Added agnostic file detection for email attachment