I\'ve found how to filter by the time and subject, but there isn\'t attribute like "sender" for mail object. The code below:
getMail(mail, pwd, IMAP