now accepts mails with .pdf extension, made more efficient