Home-Assistant-Mail-And-Packages: ISSUE: iCloud IMAP server not supported
Describe the bug
Using iCloud’s IMAP server (imap.mail.me.com) will never find and process emails because IMAP’s server does not support RFC822 fetch protocol.
The solution is to switch to BODY[]. I’ve done this in my local helpers.py and it works!
See: https://stackoverflow.com/questions/75444763/python-imaplib-fetching-icloud-mail-rfc822-not-working
I’ll open a PR to fix as soon as I’m able.
Environment (please complete the following information):
- OS: Docker
- Type of device: Synology
- Home Assistant version: 2024.11.2
- Hassio/Docker/Core? Docker
- Component version: 0.4.1
Logs When using iCloud, the FETCH result will always look like this:
2024-11-18 10:36:51.087 DEBUG (SyncWorker_9) [custom_components.mail_and_packages.helpers] email_search value: ('OK', [b'1'])
Screenshots N/A
Additional context The fix may require introducing a new configuration variable to switch from RFC822 to BODY[] fetch parameters. Switching the core code to BODY[] for all mail servers may break backwards compatibility.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 24
Anywhere
email_fetchis called the (RFC822) will need to be adjusted in the call.Plan is to modify the function to check if you’re using iCloud’s monstrosity of an IMAP server, and adjust the call accordingly in a single spot.
@firstof9 Sorry for the delay! LGTM!
I’ve covered it in the wiki
@firstof9 - So it was 😃, why i didn’t spot that - okay updated without errors, guess i’ll have to order something from amazon now to test it 😃
Correct, no errors found when it went looking through email and I received my first mail notifications, USPS.
Thanks, will be back later today (just away for work) and will let you know how it goes either this evening or tomorrow.