I am studying an application to trigger a PHP script based on new IMAP emails arriving on Gmail. What\'s the best way to know a new email has arrived on a Gmail IMAP account