Reason why I suggest this is that right now, mail-notifier may try to fetch over 1000 emails at a time depending on your search query, which often overloads a server, meaning that the server will return an invalid command, as it's unable to process that many emails.
Considering how the code is written, you could split up the uid list into smaller lists and only fetch the emails assigned those uids and process those before moving onto the next set of uids.
Reason why I suggest this is that right now, mail-notifier may try to fetch over 1000 emails at a time depending on your search query, which often overloads a server, meaning that the server will return an invalid command, as it's unable to process that many emails.
Considering how the code is written, you could split up the uid list into smaller lists and only fetch the emails assigned those uids and process those before moving onto the next set of uids.