Better Email Q&A

Posted on
Sat May 06, 2017 3:34 pm
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Better Email Q&A

Sent, no worries! Thanks very much :D

Posted on
Sat May 06, 2017 4:17 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email Q&A

I just looked at the raw message. It's mickeysoft crazy email content. It's doing multipart with png and gif and HTML and plain text. I think the problem is the HTML and plain text parts are encoded base-64 for some bizarre reason. I'll need to look at the code to see what I need to do to decode it properly.


Sent from my iPad using Tapatalk

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

Posted on
Mon May 08, 2017 2:24 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email Q&A


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

Posted on
Tue May 30, 2017 4:35 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: Better Email Q&A

Hey Joe,

Got another question for you. How can I send an HTML formatted email from the command line? I currently use this command:

bePlugin.executeAction("sendEmail", deviceId=outboundEmailDeviceId,props={'emailTo':emailTo, 'emailSubject':emailSubject, 'emailMessage': report})

However, since the file is HTML formatted, it all gets translated and the tags show up in the message. When I cut and past the message into an Action Group and select the 'HTML' format from your dropdown list, the messages render perfectly. Is html another prop I can add to that previous command, perhaps, or is it not exposed to the commandline?

thanx!
~ken

Posted on
Tue May 30, 2017 4:40 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email Q&A

This should work:

Code: Select all
bePlugin.executeAction("sendEmail", deviceId=outboundEmailDeviceId,props={'emailTo':emailTo, 'emailSubject':emailSubject, 'emailMessage': report, 'emailFormat': "html"})

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

Posted on
Tue May 30, 2017 4:42 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: Better Email Q&A

HAH.. Nevermind. I answered my own question. This works perfectly:

Code: Select all
bePlugin.executeAction("sendEmail",deviceId=outboundEmailDeviceId,props={'emailFormat':'html', 'emailTo':emailTo, 'emailSubject':emailSubject, 'emailMessage': body})

Thanx, as always, for the plugin!

~ken

Posted on
Thu Jun 22, 2017 2:10 pm
kennybroh offline
Posts: 531
Joined: Dec 13, 2009
Location: Baltimore

Re: Better Email Q&A

I'm getting a slew of these errors. I've cut off a bunch of the ascii. Indigo and the plugijn are up to date, and the gmail pop server shows a "success" state. Any ideas?
Code: Select all
Jun 22, 2017, 3:33:37 PM

   Better Email Error              Error fetching Message 1: line too long

   Better Email Error              Error fetching Message 2: line too long

   Better Email Error              Error fetching Message 3: line too long

   Better Email Error              Error fetching Message 4: line too long

   Better Email Error              Error fetching Message 5: line too long

   Better Email Error              Error fetching Message 6: line too long

   Better Email Error              Error fetching Message 7: line too long

   Better Email Error              Error fetching Message 8: line too long

   Better Email Error              Error fetching Message 9: line too long

   Better Email Error              Error fetching Message 10: line too long

   Better Email Error              Error fetching Message 11: line too long

   Better Email Error              Error fetching Message 12: line too long

   Better Email Error              Error fetching Message 13: line too long

   Better Email Error              Error fetching Message 14: line too long

   Better Email Error              Error fetching Message 15: line too long

   Better Email Error              Error fetching Message 16: line too long

   Better Email Error              Error fetching Message 17: line too long

   Better Email Error              Error fetching Message 18: line too long

   Better Email Error              Error fetching Message 19: line too long

   Better Email Error              Error fetching Message 20: line too long

   Better Email Error              Error fetching Message 21: line too long

   Better Email Error              Error fetching Message 22: /9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAD0AbM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09xisvc4OU5qTzpQY3YH5eODSHcvPLhvKhGCeuaz7qQLKpHIzTpbsvODsIJ7ZxSTGGSHLfJKDnBoHcikn8w5cn2FV3OQelRs2elNJwO+aBjWYZxSHgH3qNzk5ppOce1ADv8ail4BYdaczEDpmo3Y8HH4UrhYe5wox6YqCQnKk5I9K



Thanks

Posted on
Thu Jun 22, 2017 2:29 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email Q&A

kennybroh wrote:
I'm getting a slew of these errors. I've cut off a bunch of the ascii. Indigo and the plugijn are up to date, and the gmail pop server shows a "success" state. Any ideas?


Turn on debug logging for the plugin and try it again. Also, zip up the full email message (including headers) from your email client and attach it here or PM it to me.

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

Posted on
Thu Jun 22, 2017 3:27 pm
kennybroh offline
Posts: 531
Joined: Dec 13, 2009
Location: Baltimore

Re: Better Email Q&A

Turned debugging on but it really doesn't add anything. Same messages with the only debug message "Retrieving Message #n" under the error "Error fetching Message n: line too long".

So I disabled all of the triggers which use the plugin and it is still giving me the error. Why is the plugin trying to retrieve every message in the inbox if nothing is asking for anything within indigo?

Also it is going through 250 messages, reporting the same error for all of them.

Posted on
Thu Jun 22, 2017 3:45 pm
kennybroh offline
Posts: 531
Joined: Dec 13, 2009
Location: Baltimore

Re: Better Email Q&A

This particular mailbox is just used to communicate with indigo. I deleted all the messages, and here's what the log now shows:

Jun 22, 2017, 5:44:30 PM
Better Email Debug Connecting to POP Server: KBF Indigo email
Better Email Debug Retrieving Message # 1
Better Email Error Error fetching Message 1: line too long
Better Email Debug Retrieving Message # 2
Better Email Error Error fetching Message 2: line too long
Better Email Debug Logged out from POP server


But there are no emails there.

Posted on
Thu Jun 22, 2017 4:49 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email Q&A

kennybroh wrote:
So I disabled all of the triggers which use the plugin and it is still giving me the error. Why is the plugin trying to retrieve every message in the inbox if nothing is asking for anything within indigo?


Triggers have nothing to do with fetching messages. The plugin always attempts to fetch all messages in the POP mailbox. It (tries to) ignore messages it's seen before. Then, for each message it fetches, it checks to see if any of the messages match the trigger conditions.

In general, it's good practice to have the plugin delete messages from the server when it processes them. Or have some other mechanism to clear them out on a regular basis. Otherwise it spends a lot of time fetching old messages that have already been processed.

In your case, I'm a little stumped on why it's fetching 2 messages when you say the POP mailbox is empty. The server should have replied with a count of 0, which would cause the plugin to just close the connection.

Who's the POP service provider?

Also, check the preferences file for the plugin. What's in the readMessages line?

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

Posted on
Thu Jun 22, 2017 5:12 pm
kennybroh offline
Posts: 531
Joined: Dec 13, 2009
Location: Baltimore

Re: Better Email Q&A

OK, now I completely cleaned out the mailbox, and the plugin is not reporting any messages:

Better Email Debug Connecting to POP Server: KBF Indigo email
Better Email Debug No messages to process
Better Email Debug Logged out from POP server

So I sent a test email to it to see what happened, I have a trigger set up to respond to an email that has "outside lights" in the subject, and I sent an email with that in the subject, but it did not activate the trigger:

Better Email Debug Connecting to POP Server: KBF Indigo email
Better Email Debug Retrieving Message # 1
Better Email Debug Parsing message GmailId15cd20bafbd6689a
Better Email Debug Received Message Subject: outside lights
Better Email Debug Received Message From: Kenneth Frank <kennybroh@gmail.com>
Better Email Debug Received Message To: kbfindigo@gmail.com
Better Email Threaddebug checkMsgs: Updating states on server: [{'value': 'Kenneth Frank <kennybroh@gmail.com>', 'key': 'messageFrom'}, {'value': 'outside lights ', 'key': 'messageSubject'}, {'value': '', 'key': 'messageText'}, {'value': 'GmailId15cd20bafbd6689a', 'key': 'lastMessage'}]
Better Email Debug Checking Triggers for Device KBF Indigo email (1441975309)
Better Email Debug Checking Trigger turn on outside lights (534339360), stringMatch
Better Email Debug Checking Device State messageSubject for string: outside lights
Better Email Debug No Match for Trigger turn on outside lights (534339360)
Better Email Debug Deleting Message # 1
Better Email Debug Logged out from POP server

Another question. It says it is deleting the message, and the next time it doesn't process that message. But when I go into my mailbox on gmail or in the mail app, it is physically still in the inbox.

Posted on
Thu Jun 22, 2017 6:13 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email Q&A

I've never had any reports that it's not deleting POP messages properly. It might be some sort of race condition within Gmail that it's not showing the updated status right away. If you run the plugin again, does it still think the message is there? Or if you re-open the web interface page, is it still there?

The error you were originally getting might have been caused by the number of messages in the inbox. I never tested the way I store the record of seen messages with that many messages.

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

Posted on
Thu Jun 22, 2017 6:14 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email Q&A

Also, should that trigger have fired? The log is saying no match. Is that correct?

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

Posted on
Thu Jun 22, 2017 8:36 pm
kennybroh offline
Posts: 531
Joined: Dec 13, 2009
Location: Baltimore

Re: Better Email Q&A

There was a match. It should have fired.

Who is online

Users browsing this forum: No registered users and 1 guest