Send Email To NR And Reply

#1

Hello folks,

I had a request today and was not sure if it was possible so I thought I would ask.
Can an email be sent to Node-Red running on a RPi3B+, then make NodeRed reply to the last email’s sender with data?

Example:

I want to know the status of a boiler. Temperature, Water Level, Faults, etc.
I want to send an email to boiler@mycompany.com. Node-Red will receive the email and then poll the boiler for the status values, add them into an email body and send the values back to me.

Been researching for the last couple of hours and there is a node that can send/get emails but no one seems to be using the get email node.

Again, I’m not even sure if it is possible or if an email would even be able to get to node-red.

The company mail server is hosted locally with Node-Red on the same network. I know it can send emails, but not sure if it would be able to receive. Maybe if the email is sent from a device that is also on the network, but not if one tries to email the boiler from home or from a cell phone.

Please share your thoughts.

0 Likes

#2

It works for both sending and receiving Emails

1 Like

#3

If this is a corporate solution (sounds like) then you would have to check what message connection types they allow - they may for instance not allow POP3/IMAP for security reasons (as an example) - if so then this email node will not help you.

Many companies run Exchange inhouse and will not allow POP/IMAP mail in

regards

Craig

1 Like

#4

Thank you. It is for a corporate site and we use Microsoft Exchange/Office365.

I had my doubts that it would work, and I will still give it a try. At least I know now that if it doesn’t wotk, not to put much more effort into it.

Thank you again for sharing. I appreciate it.

0 Likes

#5

You will need to check with your IT team anyway since they will be very unhappy with you if you just try to access their shiny Exchange system! It is generally best (bear in mind that I am head of technology and security at a public body) if you do a quick write-up of what you are trying to achieve before speaking to them so that they can assess it for feasibility and security.

You should, of course, be doing this anyway if you are creating an application to be used in your enterprise.

Exchange is easy enough to configure for IMAP use so they may already have this set up for application access. Certainly, if you are using Exchange Online (Office 365), there is a suitable gateway for programmatic access. You will, of course, have to make sure that your security is tight since Node-RED has not been audited for enterprise security use and will need some remedial work to ensure it meets your corporate standards.

1 Like

#6

Thank you Totally,

You just convinced me to abandon this all together. Lol

0 Likes

#7

Possibly you could use telegram to accomplish a similar thing.

0 Likes

#8

Sorry about that. There are lots of opportunities for Node-RED to be used successfully in business and enterprise situations but I find that many business people don't quite get the risks along with the opportunities.

The risks are absolutely manageable but really mustn't be ignored. For example, in your case, it might be possible to run Node-RED in Azure with a private link to Exchange Online on the one hand and a VPN/ExpressRoute connection to your enterprise network on the other. So dealing with many of the security issues by keeping it all off the Internet.

But as you can see, this isn't then something you can simply knock together locally without a bit of help.

On the other hand, if you are being allowed to run Node-RED on your desktop, you will find that some simple linking to a simple PowerShell script would let you send emails via Outlook. Slightly more complex to monitor a folder (incl. inbox) for specific types of mail but not much.

There is also a way to send actionable emails via Outlook. These can contain URL links and even to collect specific information - effectively creating an actionable form that can be sent.

So actually, there are lots of ways of doing these things.

You might also want to look at Microsoft Flow which is a little like a more complete version of IFTTT for corporate use. If you have Office 365 enterprise licensing, you will have access to that.

https://flow.microsoft.com/en-us/

That would give you all sorts of options including Email integration along with Microsoft Forms and Microsoft PowerApps. And would give several ways of interacting with Node-RED as well.

0 Likes

#9

Thank you for the explanation Totally and for your advice.

I definitely don’t want to do anything that may jeopardize our security. A quick look at Microsoft Flow seems promising. I will have to play with it.
At the very least, it seems it could be setup to gather data and then present the data to an email receipt securely. Out on event but not In so to speak.

Still, I believe that we need a different approach to solving this. One that does not jeopardize our security. If it is not feasible then I will just tell them to forget it.

1 Like