* check invalid mailbox pgp key * check if public key is valid before trying with pgpy * fix query * remove unused code