Better Email plugin discussion thread

User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Post by FlyingDiver »

I'm going to need to see the raw source of the email you're trying to process. It's either a totally empty body, which I can't replicate, or it's some sort of multipart payload which I'm not handling properly.

What email client are you using to send these test messages? Gmail web interface?

Can you view the raw source of one of the emails (in your Sent folder) and post it here?

Thanks!

Edit: Nevermind. I see it is the Gmail web client doing something weird with multipart messages. I'll test more with it and see what I can do.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
jblackburn
Posts: 76
Joined: Wed Dec 11, 2013 2:51 pm
Location: Quebec, Canada

Re: Better Email plugin discussion thread

Post by jblackburn »

If you need help, tell me!

Thanks!

Joël
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Post by FlyingDiver »

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
jblackburn
Posts: 76
Joined: Wed Dec 11, 2013 2:51 pm
Location: Quebec, Canada

Re: Better Email plugin discussion thread

Post by jblackburn »

Problem solved! All special code works!

Thanks!

Joël
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Post by FlyingDiver »

Great. Thanks for the report.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
jonc
Posts: 12
Joined: Tue Apr 19, 2016 4:42 pm

Re: Better Email plugin discussion thread

Post by jonc »

I cannot seem to get this plugin to work with iCloud email. Log mentions SSL errors. Anyone else have experience with this?
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Post by FlyingDiver »

jonc wrote:I cannot seem to get this plugin to work with iCloud email. Log mentions SSL errors. Anyone else have experience with this?
Are you setting up an IMAP or SMTP device?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
jonc
Posts: 12
Joined: Tue Apr 19, 2016 4:42 pm

Re: Better Email plugin discussion thread

Post by jonc »

Both. I get an error on both devices. I can access the email account succesfully from the web, Mail.app on the Mac, and Mail on iOS.
jonc
Posts: 12
Joined: Tue Apr 19, 2016 4:42 pm

Re: Better Email plugin discussion thread

Post by jonc »

Better Email Error SMTP server connection error: [Errno 1] _ssl.c:490: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

smtp.mail.me.com port 587
[email protected]
correctPassword
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Post by FlyingDiver »

OK, looks like iCloud doesn't like SSL as I have it implemented, and I'll have to implement another code path for STARTTLS. I don't know how soon I'll be able to get to that, as we're about to move into our new house. I'll get to it as soon as I can. In the meantime, can you use GMail or something else?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
jonc
Posts: 12
Joined: Tue Apr 19, 2016 4:42 pm

Re: Better Email plugin discussion thread

Post by jonc »

OK. Thanks for looking at it.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Post by FlyingDiver »

Try this version: https://github.com/FlyingDiver/BetterEm ... artTLS.zip

Edit your devices to set the Encryption type. It's now a popup selector rather than just a check box for SSL.

I think the StartTLS option works for SMTP, and the SSL option for IMAP now seems to be working for iCloud.

I have not been able to get StartTLS to work for IMAP, but that's not too surprising as that protocol is not supported in the standard Python libraries until Python 3.2. I'm using an alternate version of imaplib that does IDLE, and it's supposed to do StartTLS but something is wonky with it.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
RedYuriPrime
Posts: 56
Joined: Tue Oct 14, 2014 1:01 pm
Location: Oxford

Re: Better Email plugin discussion thread

Post by RedYuriPrime »

Hi Joe,
What I want to be able to do is receive an email, do some basic checks on the source and the subject, and then load the body of the email as text into a variable or save it to file, so that I can then come back and parse it in detail at my leisure. :D
I sort of get the impression this should be a relatively easy step from where your plugin gets, but either that it doesn't actually enable this, or else I am missing something, which is entirely plausible :!: Is this something you can help with?
Thanks
Geoff
Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Post by FlyingDiver »

RedYuriPrime wrote:Hi Joe,
What I want to be able to do is receive an email, do some basic checks on the source and the subject, and then load the body of the email as text into a variable or save it to file, so that I can then come back and parse it in detail at my leisure. :D
I sort of get the impression this should be a relatively easy step from where your plugin gets, but either that it doesn't actually enable this, or else I am missing something, which is entirely plausible :!: Is this something you can help with?
Thanks
Geoff
This should be pretty straightforward. First, you need to set up an IMAP or POP device to actually talk to the email server and look for messages.

Then, set up a Trigger for handling the emails you want to capture. You can use both a regex in the trigger and (if necessary) additional regex in the conditions to determine if it's an email you want to save.

Then, in the actions, use Variable Actions -> Insert Device State into Variable to save the parts of the message you want. Or you could write them to the log using the substitution syntax.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
rycardo
Posts: 53
Joined: Fri Jul 10, 2015 6:22 pm

Re: Better Email plugin discussion thread

Post by rycardo »

I think the StartTLS option works for SMTP, and the SSL option for IMAP now seems to be working for iCloud.
I was getting the same error messages mentioned above with Namespro.ca SMTP servers, this updated version with the StartTLS option has resolved the errors, and your plug-in now is sending email again.

Thanks,

Rycardo
Locked

Return to “Better Email”