I'm having some trouble getting this code to recognize incoming mail. It skips right over my @msgs = $imap->sentsince($now); and goes around again. It never detects the incoming mail. The changes I've made are very slight; there's a diff of them in my scratchpad. I'm kind of at a loss. Any thoughts are welcome!
They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen
Hm, IMAP provides a stable view of a mailbox (so that you can delete or move things by numeric index) until the next time you select a folder. In order to see changes to an inbox, you typically need to re-select it. I'm suspicious that the code above doesn't show signs of doing that.
I believe there's also a way to get push-notifications from the server, but I don't know the technical details there, just that Thunderbird+Dovecot make that work.
Good thought! I tried putting $imap->select( $imap_folder ) or die "IMAP Select Error for imap folder [$imap_folder]: $@"; inside the while loop, and still got no joy.
They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen