This script uses imaplib to fetch emails from a specific imap folder.
imaplib
It currently support fetching from an unlimited number of accounts taken from sqlite.