Email receive error

Posted on
Tue Aug 09, 2022 11:06 am
mikelo offline
Posts: 14
Joined: Apr 23, 2022

Email receive error

I'm trying to use the built-in email plugin to read an incoming email from the Apple mail service. I get an error message as follows when set to read either the message title or message body:

Code: Select all
Aug 9, 2022 at 11:38:54
   Email+ Error                    Apple IMAP incoming: IMAP server connection error: 'ascii' codec can't encode characters in position 3625-3627: ordinal not in range(128)

I'm trying to troubleshoot this and don't even know where to start. I'm sending a simple text message, so don't know why it's complaining about non-ASCII characters.


Mike

Posted on
Tue Aug 09, 2022 11:36 am
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Email receive error

Turn on debug logging for the plugin then try again.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Aug 09, 2022 5:24 pm
mikelo offline
Posts: 14
Joined: Apr 23, 2022

Re: Email receive error

Turned on debugging. Results:
Code: Select all
Email+ Debug                    Gmail send server: SMTP poll, 0 items in queue
   Email+ Debug                    Apple IMAP incoming: Polling IMAP Server
   Email+ Debug                    Apple IMAP incoming: Doing connect using encryptionType = SSL
   Email+ Debug                    Apple IMAP incoming: Doing login()
   Email+ Debug                    Apple IMAP incoming: Doing select()
   Email+ Debug                    Apple IMAP incoming: Doing checkMsgs
   Email+ Debug                    Apple IMAP incoming: checkMsgs - typ = OK, msg_ids = [b'1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51…..

Number incrementing keeps going up until I finally stopped the program. It appears that the plugin is scanning all the messages in the mailbox. If it has to do this every time requested, it won't be useful. If absolutely necessary, I could create a new Apple ID for this, I suppose.

I used the old default program for years and it worked fine. Since it was deprecated, I have not been able to use this function. I'm just trying to figure out a simple way to notify Indigo to know whether I'm home or not. Scanning emails was simple and completely reliable. Until it wasn't.

Mike

Posted on
Tue Aug 09, 2022 6:11 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Email receive error

It won't scan them all once it's finished the first scan, but if it's failing before it can finish a complete scan then this is what you get. Just make sure you don't have the "Re-process already seen" option checked.

Best practice is to use a dedicated INBOX for Indigo email. Usually that means an email account just for Indigo.

The old system used POP instead of IMAP. You could try using a POP server instead to see if that works better.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Aug 11, 2022 2:46 pm
mikelo offline
Posts: 14
Joined: Apr 23, 2022

Re: Email receive error

I tried using a Gmail pop server, which worked fine with the old email system. Had problems with authentication with new system, with both normal and two factor sign ins. However, I can send emails from Gmail with the new system just fine, just not receive.

Posted on
Fri Aug 12, 2022 10:22 am
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Email receive error

That's odd, I would think that the same authentication would work for both. But it's Gmail, so who knows? FWIW, Gmail is NOT a recommended provider for any IMAP/POP services. Their implementation of the protocol is sub-standard. They don't use it for their own clients, so they really don't care how well it works.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Sep 29, 2022 1:07 pm
mgolden50 offline
User avatar
Posts: 259
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Email receive error

Hi Joe,
After giving up on getting the Email+ plugin to work with Gmail accounts. I created a new Zoho email account. Now I can't get it work with that either.
Below is are some Event Log entries with debug turned on: Any guidance would be much appreciated.
I'm on Indigo version 2022.1.2

I'm only trying to trigger on received IMAP emails.

Thanks,
Mike

Sep 26, 2022 at 2:52:57 PM
Email+ Warning Zoho Mail: IDLE Event Timeout. This usually indicates a communication issue. We will shut down the IMAP Server, wait several minutes, and start it back up.
Email+ Processing restart request for device 'Zoho Mail', will restart in 4.983333333333333 minutes
Email+ Debug Zoho Mail: Stopping device
Email+ Debug Zoho Mail: shutting down
Email+ Debug Zoho Mail: Stopping IDLE connection
Email+ Error Zoho Mail: IMAP IDLE server shutdown error: connection closed
Email+ Debug connErrorTriggerCheck: Checking Triggers for Device Zoho Mail (1935550292)
Email+ Debug Checking Trigger Email Received Car Is Locked (re-lock event) (47951295), stringMatch
Email+ Debug Skipping Trigger Email Received Car Is Locked (re-lock event) (47951295), wrong device: 1935550292
Email+ Debug Checking Trigger Email Received Leaves Home - Mike (533617350), stringMatch
Email+ Debug Unknown Trigger Type Email Received Leaves Home - Mike (533617350), stringMatch
Email+ Debug Checking Trigger Email Received Arrives Home - Carol (670320014), stringMatch
Email+ Debug Unknown Trigger Type Email Received Arrives Home - Carol (670320014), stringMatch
Email+ Debug Checking Trigger Email Received Car Is Unlocked (1139538493), stringMatch
Email+ Debug Skipping Trigger Email Received Car Is Unlocked (1139538493), wrong device: 1935550292
Email+ Debug Checking Trigger Email Received Leaves Home - Carol (1567389344), stringMatch
Email+ Debug Unknown Trigger Type Email Received Leaves Home - Carol (1567389344), stringMatch
Email+ Debug Checking Trigger Email Received Car Is Locked (not a re-lock event) (1693525627), stringMatch
Email+ Debug Skipping Trigger Email Received Car Is Locked (not a re-lock event) (1693525627), wrong device: 1935550292
Email+ Debug Checking Trigger Email Received Arrives Home - Mike (1784495671), stringMatch
Email+ Debug Unknown Trigger Type Email Received Arrives Home - Mike (1784495671), stringMatch

Sep 26, 2022 at 2:57:57 PM
Email+ Starting mail device 'Zoho Mail'
Email+ Debug Zoho Mail: Starting device (imapAccount)
Email+ Debug Zoho Mail: Creating IMAP Server
Email+ Debug Zoho Mail: Using IMAP IDLE
Email+ Debug Zoho Mail: Doing connect using encryptionType = SSL
Email+ Debug Zoho Mail: Doing login()
Email+ Debug Zoho Mail: Doing select()
Email+ Debug Zoho Mail: idleIMAPThread() called

Sep 26, 2022 at 3:26:59 PM
Email+ Debug Zoho Mail: IDLE Event Received
Email+ Debug Zoho Mail: Polling IMAP Server
Email+ Debug Zoho Mail: Doing checkMsgs
Email+ Error Zoho Mail: IMAP checkMsgs error: connection closed

Posted on
Thu Sep 29, 2022 6:46 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Email receive error

First thing I would do is turn off IDLE mode in the device configuration. Not all IMAP servers support it.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Sep 30, 2022 12:06 pm
mgolden50 offline
User avatar
Posts: 259
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Email receive error

Thanks Joe,

That was the problem

Posted on
Wed Nov 29, 2023 10:49 am
joeaug offline
Posts: 28
Joined: Apr 13, 2019

Re: Email receive error

After using this plugin successfully for the past several months using Apple email servers, I am getting the same error as the previous poster all of a sudden. The best I can tell this started about a week ago? Don;t know if Apple changed something but here's what I get:

Code: Select all
Email+ Error                    EMAIL Incoming: IMAP server connection error: 'ascii' codec can't encode characters in position 357-360: ordinal not in range(128)


I never had IDLE checked, so this can't be the problem for me. Any ideas?

Sadly, it's getting harder and harder to send and receive emails using applications like this due to rising security, and I'm wondering how long before we can't do this at all any more. Email is such a vital function too for a home automation app.

Posted on
Wed Nov 29, 2023 10:51 am
joeaug offline
Posts: 28
Joined: Apr 13, 2019

Re: Email receive error

I will post the results of detailed debugging next time I get the error.....

Posted on
Wed Nov 29, 2023 11:21 am
joeaug offline
Posts: 28
Joined: Apr 13, 2019

Re: Email receive error

The debugging messages are just an endless stream of:

Email+ Debug EMAIL Incoming: Message # b'1598' already seen, skipping...
Email+ Debug EMAIL Incoming: Message # b'1599' Flags = '[b'1599 (FLAGS (\\Seen $IndigoProcessed))']'
Email+ Debug EMAIL Incoming: Message # b'1599' already seen, skipping...
Email+ Debug EMAIL Incoming: Message # b'1600' Flags = '[b'1600 (FLAGS (\\Seen $IndigoProcessed))']'
Email+ Debug EMAIL Incoming: Message # b'1600' already seen, skipping...
Email+ Debug EMAIL Incoming: Message # b'1601' Flags = '[b'1601 (FLAGS (\\Seen $IndigoProcessed))']'
Email+ Debug EMAIL Incoming: Message # b'1601' already seen, skipping...
Email+ Debug EMAIL Incoming: Message # b'1602' Flags = '[b'1602 (FLAGS (\\Seen $IndigoProcessed))']'
Email+ Debug EMAIL Incoming: Message # b'1602' already seen, skipping...

Posted on
Wed Nov 29, 2023 11:40 am
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Email receive error

We never did figure out exactly what was causing the error seen by @mikelo, but I have some ideas. It seems you do have one symptom in common with him, you're asking the plugin to scan an INBOX that's has MANY emails in it. This is definitely something that is NOT recommended. General rules of thumb:

1. Use a dedicated email account for Indigo
2. Keep the inbox cleaned up. Use the device options to either delete the messages after processing or move them to another mailbox.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Nov 29, 2023 11:41 am
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Email receive error

I'm curious. How many email messages are actually in that INBOX?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Nov 29, 2023 11:53 am
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Email receive error

Also, restart the plugin with debug logging enabled, and look for a line with something like:
Code: Select all
checkMsgs - typ = OK, msg_ids =


I need that entire line.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Who is online

Users browsing this forum: No registered users and 1 guest