I'm having the same issue. Has been working fine in the past.
I tried deleting all app generated passwords and creating a new one
I also tried creating a new profile in thunderbird and setting up the .mac account with the new password.
I also tried running the latest thunderbird beta.
I turned on IMAP logging for thunderbird and got this additional information.
2017-08-08 17:59:07.193000 UTC - [Main Thread]: D/IMAP proposed url = INBOX folder for connection INBOX has To Wait = TRUE can run = FALSE
2017-08-08 17:59:07.193000 UTC - [Main Thread]: I/IMAP queuing url:imap://jbascom@imap.mail.me.com:993/fetch>UID>/INBOX>44752
2017-08-08 17:59:07.193000 UTC - [Main Thread]: I/IMAP considering playing queued url:imap://jbascom@imap.mail.me.com:993/fetch>UID>/INBOX>44749
2017-08-08 17:59:07.193000 UTC - [Main Thread]: I/IMAP creating protocol instance to play queued url:imap://jbascom@imap.mail.me.com:993/fetch>UID>/INBOX>44749
2017-08-08 17:59:07.193000 UTC - [Main Thread]: D/IMAP proposed url = INBOX folder for connection INBOX has To Wait = TRUE can run = FALSE
2017-08-08 17:59:07.193000 UTC - [Main Thread]: I/IMAP failed creating protocol instance to play queued url:imap://jbascom@imap.mail.me.com:993/fetch>UID>/INBOX>44749
2017-08-08 17:59:07.208000 UTC - [Main Thread]: I/IMAP considering playing queued url:imap://jbascom@imap.mail.me.com:993/fetch>UID>/INBOX>44749
2017-08-08 17:59:07.208000 UTC - [Main Thread]: I/IMAP creating protocol instance to play queued url:imap://jbascom@imap.mail.me.com:993/fetch>UID>/INBOX>44749
2017-08-08 17:59:07.208000 UTC - [Main Thread]: D/IMAP proposed url = INBOX folder for connection INBOX has To Wait = FALSE can run = TRUE
2017-08-08 17:59:07.208000 UTC - [Main Thread]: I/IMAP playing queued url:imap://jbascom@imap.mail.me.com:993/fetch>UID>/INBOX>44749
2017-08-08 17:59:07.209000 UTC - [Unnamed thread 1CAE64B0]: I/IMAP 1D03D800:imap.mail.me.com:S-INBOX:ProcessCurrentURL: entering
2017-08-08 17:59:07.209000 UTC - [Unnamed thread 1CAE64B0]: I/IMAP 1D03D800:imap.mail.me.com:S-INBOX:ProcessCurrentURL:imap://jbascom@imap.mail.me.com:993/fetch%3EUID%3E/INBOX%3E44749: = currentUrl
2017-08-08 17:59:07.213000 UTC - [Unnamed thread 1CAE64B0]: D/IMAP SHELL: URL imap://jbascom@imap.mail.me.com:993/fetch%3EUID%3E/INBOX%3E44749, OKToFetchByParts 0, allowedToBreakApart 1, ShouldFetchAllParts 0
2017-08-08 17:59:07.213000 UTC - [Unnamed thread 1CAE64B0]: D/IMAP FetchTryChunking: curFetchSize 24541
2017-08-08 17:59:07.213000 UTC - [Unnamed thread 1CAE64B0]: D/IMAP FetchMessage everything: curFetchSize 24541 numBytes 0
2017-08-08 17:59:07.213000 UTC - [Unnamed thread 1CAE64B0]: I/IMAP 1D03D800:imap.mail.me.com:S-INBOX:SendData: 13 UID fetch 44749 (XSENDER UID RFC822.SIZE BODY[])
2017-08-08 17:59:07.226000 UTC - [Unnamed thread 1CAE64B0]: D/IMAP ReadNextLine [stream=1DFB4150 nb=44 needmore=0]
2017-08-08 17:59:07.226000 UTC - [Unnamed thread 1CAE64B0]: I/IMAP 1D03D800:imap.mail.me.com:S-INBOX:CreateNewLineFromSocket: 13 BAD Invalid UID Fetch attribute XSENDER