'Phantom' email after deleting Cron event

I am struggling with this problem.

I was wanting to send an email once a day, so I set up node-red-contrib-cron-plus at the suggestion of @TotallyInformation (never had cron so easy to set up and foolproof! Thank you @Steve-Mcl ), along with node-red-node-email (1.7.8) and all worked well. As my knowledge and confidence increased, I needed to delete the old cron event and set up two more as I modified/improved the function .

The next time the old event came around, an email was sent, along with the two new ones. In investigating this, I found that that available version of cron-plus in Palette Manager is at 0.4.0. I also found that the current version was available in npm/github (0.6.7). So I updated to this. I still got the old deleted event email (along with the correct new ones).

I have removed/reinstalled both the cron-plus and email in various options, including ensuring the directories for the flow had been removed, but I am still getting the 'Phantom' email. I have searched the flows (both with the tool and manually) and there is no other place that email is used other than in this little bit of flow. I am wondering if an 'artifact' remains in the Cron job?

Basically, I want to remove this old email and wondered if someone could help me track down the problem.

TIA

[{"id":"2d533cea.488ddc","type":"function","z":"6f1afdfb.ef50cc","name":"Me","func":"var slots = msg.topic;\nmsg.topic = \"Octopus slots for \" + slots;\nmsg.payload = global.get(\"expensive\")||0;\nmsg.payload += \"\\n\\n\";\nmsg.payload += \"The best times to do stuff are:\";\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute30\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute60\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute90\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute120\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute150\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute180\")||0;\nmsg.payload += \"\\n\";\nmsg.to = \"you@example.com\";\nmsg.from = \"nodered@example.com\";\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":100,"wires":[["85c6b81b.c94818"]]},{"id":"1d149752.4ac811","type":"cronplus","z":"6f1afdfb.ef50cc","name":"send_eMails","outputField":"topic","timeZone":"","outputs":1,"options":[{"expressionType":"cron","topic":"evening","payload":"1900hrs today to 2300hrs tomorrow","type":"str","expression":"0 0 19 * * *","location":"","offset":"0"},{"expressionType":"cron","topic":"morning","payload":"0800hrs to 2300hrs today","type":"str","expression":"0 0 8 * * *","location":"","offset":"0"}],"x":190,"y":100,"wires":[["2d533cea.488ddc"]]},{"id":"85c6b81b.c94818","type":"e-mail","z":"6f1afdfb.ef50cc","server":"smtp.example.com","port":"587","secure":false,"tls":false,"name":"","dname":"","x":530,"y":100,"wires":[]}]

23 May 11:08:25 - [info]
Welcome to Node-RED

23 May 11:08:25 - [info] Node-RED version: v1.0.6
23 May 11:08:25 - [info] Node.js version: v10.20.1
23 May 11:08:25 - [info] Linux 4.19.97-v7+ arm LE
23 May 11:08:26 - [info] Loading palette nodes
23 May 11:08:34 - [info] Dashboard version 2.22.1 started at /ui
23 May 11:08:36 - [info] Settings file : /home/pi/.node-red/settings.js
23 May 11:08:36 - [info] Context store : 'default' [module=memory]
23 May 11:08:36 - [info] User directory : /home/pi/.node-red
23 May 11:08:36 - [info] Server now running at http://127.0.0.1:1880/

Can you export your flow (minus the email node) ?

The Cron schedules are recreated when you deploy a change so it shouldn't do that but I'll take a look if necessary.

@mudwalker sorry - i didnt spot your flow export above.

Would you be willing to help me help you?

First, some questions - in you actual flow, do you fire anything into the CRON node?

Secondly, could you put this bit of logging node in your flow...

image

then report after it happens again showing whats in flow.cron_log...
image

this is the function code...

var contextname = "cron_log";

var log = flow.get(contextname) || [];

var logEntry = {
    msg: RED.util.cloneMessage(msg),
    time: new Date()
}

log.push(logEntry);

flow.set(contextname, log);

return msg;
2 Likes

Hi Steve,

Yes, of course, I need the help and am willing to learn.

There is no input to the cron-plus node.

What you see is the flow. The cron-plus node fires the function which gathers data from other parts of the flow and adds text to msg.topic for the subject of the email.

The text inserted into message payload...

Most expensive slots today are between:
Sat May 23 2020 4:00:00 PM and Sat May 23 2020 7:00:00 PM - Cost: 13.29p per kWh

The best times to do stuff are:
1/2 hour slot - Sat May 23 2020 2:30:00 PM - Cost: -10.78p per kWh
1 hour slot - Sat May 23 2020 2:30:00 PM - Cost: -10.68p per kWh
1.5 hour slot - Sat May 23 2020 2:00:00 PM - Cost: -10.43p per kWh
2 hour slot - Sat May 23 2020 2:00:00 PM - Cost: -10.30p per kWh
2.5 hour slot - Sat May 23 2020 1:30:00 PM - Cost: -9.12p per kWh
3 hour slot - Sat May 23 2020 1:00:00 PM - Cost: -8.08p per kWh
...(Good day today and just so that you know what is sent in email.)

Done and now need to wait until 0800 hrs!

Thank you,
Colin

Good day,

Well, from what I can see from the Context Data, it is not the cron-plus node injecting the phantom event. All I read is that it the correct data/event was injected, but nothing else.

[{"msg":{"cronplus":{"triggerTimestamp":1590303600000,"status":{"type":"static","isRunning":true,"count":1,"limit":0,"nextDescription":"in 1 day","nextDate":"2020-05-25T07:00:00.000Z","nextDateTZ":"May 25, 2020, 08:00:00 GMT+1","timeZone":"Europe/London","serverTime":"2020-05-24T07:00:00.039Z","serverTimeZone":"Europe/London","description":"At 08:00 AM"},"config":{"name":"morning","payload":"0800hrs to 2300hrs today","type":"str","limit":null,"expressionType":"cron","expression":"0 0 8 * * *"}},"topic":"0800hrs to 2300hrs today","scheduledEvent":true,"_msgid":"fabf10b3.60c78"},"time":"2020-05-24T07:00:00.047Z"}]

I have run this flow with the cron-plus node removed over the appropriate time period, no message was sent (not sure if that helps!). I have now checked 'cron -l' and '/var/spool/cron/crontabs/pi', neither show any jobs (not sure if they are the same file).

Might add that the phantom does have a different subject - 'Octopus slots for today'

Thanks for the help,
Colin

ok, thanks for feedback.

No, this is pure js implementation (for cross-platform compatibility)


If you dont mind, just leave that bit logging code in place for a few days to be sure.

Cheers.

Ah, pure JS implementation, now I understand a bit more! This is where I tend to be 'very green' on some of the concepts. Hopefully getting there, but very slowly!

No problem, want to study that script and the Context Data side of things.

I will now set up another mini flow and see if I can get a 'clean' version working. Don't want to destroy the existing version until I know what is going on. Need to try to understand.

Thank you!

If you really want to learn node-red, I recommend watching this playlist: Node-RED Essentials. It is by one of the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in less than an hour. A small investment for a lot of gain.

Hope that helps.

1 Like

Had a few messages sent with the log activated, still getting the phantom email at 0800.

[{"msg":{"cronplus":{"triggerTimestamp":1590303600000,"status":{"type":"static","isRunning":true,"count":1,"limit":0,"nextDescription":"in 1 day","nextDate":"2020-05-25T07:00:00.000Z","nextDateTZ":"May 25, 2020, 08:00:00 GMT+1","timeZone":"Europe/London","serverTime":"2020-05-24T07:00:00.039Z","serverTimeZone":"Europe/London","description":"At 08:00 AM"},"config":{"name":"morning","payload":"0800hrs to 2300hrs today","type":"str","limit":null,"expressionType":"cron","expression":"0 0 8 * * *"}},"topic":"0800hrs to 2300hrs today","scheduledEvent":true,"_msgid":"fabf10b3.60c78"},"time":"2020-05-24T07:00:00.047Z"},{"msg":{"cronplus":{"triggerTimestamp":1590343200000,"status":{"type":"static","isRunning":true,"count":1,"limit":0,"nextDescription":"in 1 day","nextDate":"2020-05-25T18:00:00.000Z","nextDateTZ":"May 25, 2020, 19:00:00 GMT+1","timeZone":"Europe/London","serverTime":"2020-05-24T18:00:00.020Z","serverTimeZone":"Europe/London","description":"At 07:00 PM"},"config":{"name":"evening","payload":"1900hrs today to 2300hrs tomorrow","type":"str","limit":null,"expressionType":"cron","expression":"0 0 19 * * *"}},"topic":"1900hrs today to 2300hrs tomorrow","scheduledEvent":true,"_msgid":"8768a0fc.d42ad"},"time":"2020-05-24T18:00:00.039Z"},{"msg":{"cronplus":{"triggerTimestamp":1590390000000,"status":{"type":"static","isRunning":true,"count":1,"limit":0,"nextDescription":"in 1 day","nextDate":"2020-05-26T07:00:00.000Z","nextDateTZ":"May 26, 2020, 08:00:00 GMT+1","timeZone":"Europe/London","serverTime":"2020-05-25T07:00:00.012Z","serverTimeZone":"Europe/London","description":"At 08:00 AM"},"config":{"name":"morning","payload":"0800hrs to 2300hrs today","type":"str","limit":null,"expressionType":"cron","expression":"0 0 8 * * *"}},"topic":"0800hrs to 2300hrs today","scheduledEvent":true,"_msgid":"3d103d8d.924fd2"},"time":"2020-05-25T07:00:00.035Z"},{"msg":{"cronplus":{"triggerTimestamp":1590429600000,"status":{"type":"static","isRunning":true,"count":1,"limit":0,"nextDescription":"in 1 day","nextDate":"2020-05-26T18:00:00.000Z","nextDateTZ":"May 26, 2020, 19:00:00 GMT+1","timeZone":"Europe/London","serverTime":"2020-05-25T18:00:00.026Z","serverTimeZone":"Europe/London","description":"At 07:00 PM"},"config":{"name":"evening","payload":"1900hrs today to 2300hrs tomorrow","type":"str","limit":null,"expressionType":"cron","expression":"0 0 19 * * *"}},"topic":"1900hrs today to 2300hrs tomorrow","scheduledEvent":true,"_msgid":"f68d1d27.7af7a"},"time":"2020-05-25T18:00:00.033Z"},{"msg":{"cronplus":{"triggerTimestamp":1590476400000,"status":{"type":"static","isRunning":true,"count":2,"limit":0,"nextDescription":"in 1 day","nextDate":"2020-05-27T07:00:00.000Z","nextDateTZ":"May 27, 2020, 08:00:00 GMT+1","timeZone":"Europe/London","serverTime":"2020-05-26T07:00:00.029Z","serverTimeZone":"Europe/London","description":"At 08:00 AM"},"config":{"name":"morning","payload":"0800hrs to 2300hrs today","type":"str","limit":null,"expressionType":"cron","expression":"0 0 8 * * *"}},"topic":"0800hrs to 2300hrs today","scheduledEvent":true,"_msgid":"c536ac31.f849b"},"time":"2020-05-26T07:00:00.037Z"}]

Test script working OK, now swapping wires around to see what happens.

(Going through the tutorials again!)

Morning,

An FYI.

I created the 2nd flow to enable more tracing of the problem. Yesterday the second flow with all nodes set up from scratch worked fine, sending only one message (different from address).

After 0800 yesterday, I cross-wired the cron-plus nodes to the other flow containing the payload for the email. This morning I still got the phantom message. The from address was the original 'from' address of the deleted cron job. I know that the phantom email always comes from this from address.

[{"id":"cccf4309.ced1f8","type":"function","z":"d3b91c24.d876f","name":"Me","func":"var slots = msg.topic;\nmsg.topic = \"Octopus slots for \" + slots;\nmsg.payload = global.get(\"expensive\")||0;\nmsg.payload += \"\\n\\n\";\nmsg.payload += \"The best times to do stuff are:\";\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute30\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute60\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute90\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute120\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute150\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute180\")||0;\nmsg.payload += \"\\n\";\nmsg.to = \"Octopus CJ<email@example.com>\";\nmsg.from = \"Node Red<nodered@example.com>\";\n\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":160,"wires":[["509943da.9c33bc"]]},{"id":"ce1ac1a3.bbcb48","type":"cronplus","z":"d3b91c24.d876f","name":"send_eMails","outputField":"topic","timeZone":"","outputs":1,"options":[{"expressionType":"cron","topic":"evening","payload":"1900hrs today to 2300hrs tomorrow","type":"str","expression":"0 0 19 * * *","location":"","offset":"0"},{"expressionType":"cron","topic":"morning","payload":"0800hrs to 2300hrs today","type":"str","expression":"0 0 8 * * *","location":"","offset":"0"}],"x":290,"y":160,"wires":[["4d077160.91e3f8","4b094618.247398"]]},{"id":"509943da.9c33bc","type":"e-mail","z":"d3b91c24.d876f","server":"smtp.example.com","port":"465","secure":true,"tls":false,"name":"","dname":"","x":660,"y":180,"wires":[]},{"id":"4d077160.91e3f8","type":"function","z":"d3b91c24.d876f","name":"cron_log","func":"var contextname = \"cron_log\";\n\nvar log = flow.get(contextname) || [];\n\nvar logEntry = {\n    msg: RED.util.cloneMessage(msg),\n    time: new Date()\n}\n\nlog.push(logEntry);\n\nflow.set(contextname, log);\n\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":220,"wires":[[]]},{"id":"ad4fee30.a86608","type":"inject","z":"d3b91c24.d876f","name":"","topic":"direct inject","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":420,"wires":[["4b094618.247398"]]},{"id":"11f647e3.7f3388","type":"cronplus","z":"d3b91c24.d876f","name":"send_eMails -2","outputField":"topic","timeZone":"","commandResponseMsgOutput":"output1","outputs":1,"options":[{"expressionType":"cron","topic":"morning","payload":"morning payload","type":"str","expression":"0 59 7 * * *","location":"","offset":"0"},{"expressionType":"cron","topic":"evening","payload":"evening payload","type":"str","expression":"0 59 19 * * *","location":"","offset":"0"}],"x":280,"y":480,"wires":[["cccf4309.ced1f8"]]},{"id":"4b094618.247398","type":"function","z":"d3b91c24.d876f","name":"","func":"var slots = msg.topic;\nmsg.topic = \"Octopus slots for \" + slots;\nmsg.payload = global.get(\"expensive\")||0;\nmsg.payload += \"\\n\\n\";\nmsg.payload += \"The best times to do stuff are:\";\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute30\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute60\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute90\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute120\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute150\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute180\")||0;\nmsg.payload += \"\\n\";\nmsg.to = \"Colin CJ<testcj@example.com>\";\nmsg.from = \"Node Red<test@example.com>\";\n\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":480,"wires":[["f4fd1311.a5f57"]]},{"id":"f4fd1311.a5f57","type":"e-mail","z":"d3b91c24.d876f","server":"smtp.example.com","port":"587","secure":false,"tls":false,"name":"","dname":"","x":650,"y":480,"wires":[]}]

Today I will wire the cron job back to their respective function nodes and swap the email wires and see what happens. I will also add a Debug node to the functions.

Edit: Also added the Logging nodes to the payload functions.

2 Likes

Nothing remarkable to report, still getting the same phantom. Logging nodes worked fine (yay - what a tool!) and just show the expected messages being sent.

Today I have set the email nodes to send to different smtp servers, which should give me a trace on which route the phantom email is taking. Hopefully, this will enable the complete differentiation of the email nodes from each similar flow.

If anyone has any further suggestions, please do not hesitate to say. Don't really want to delete anything until I find the cause!

Can I confirm please - the log shows the correct amount (i.e. 2 events per day but your'e getting more emails than you should)?

could you also add a log immediately before the email node (remember to change the log name e.g. var contextname = "before_email_node"; - or similar) & see if something else is happening?

Also, have your tried searching node-red (CTRL+F) for other email nodes?

Lastly, have you restarted node-red at all since this issue began? (I'm not asking you too - just curious if there is something in the background)

The logs show the correct events for the number of messages without the phantom email.

I added logging nodes before the email nodes (after function nodes) yesterday, confirm they show the correct number of events (without phantom).

I feel pretty sure I have deleted Cron and eMail nodes and replaced them in the past when doing the chaotic faultfinding. I mention this as I tried so many things to find the faults in my scripting!! I usually go to 'Full Deploy' when I get problems like this, I have also restarted flows, updated where updating is needed (cron-plus from 0.4 to 0.6.7), other nodes and core were up to date. NPM was also updated recently.

28 May 10:03:03 - [info]
Welcome to Node-RED

28 May 10:03:03 - [info] Node-RED version: v1.0.6
28 May 10:03:03 - [info] Node.js version: v10.20.1
28 May 10:03:03 - [info] Linux 4.19.97-v7+ arm LE
28 May 10:03:04 - [info] Loading palette nodes
28 May 10:03:13 - [info] Dashboard version 2.22.1 started at /ui
28 May 10:03:14 - [info] Settings file : /home/pi/.node-red/settings.js
28 May 10:03:14 - [info] Context store : 'default' [module=memory]
28 May 10:03:14 - [info] User directory : /home/pi/.node-red
28 May 10:03:14 - [info] Server now running at http://127.0.0.1:1880/

Searched using Search (same as CTRL-F) and manually using both email and email addresses as search term.

I don't think I have missed anything, but bow to greater knowledge! I can logically develop tests, just not what you might call 'au faix' with the inner workings of Node-Red beyond the Nodes and Editor.

I could just delete the 'bad' nodes, but if this is a bug, I feel it would be more beneficial if it were tracked down.

I think the different smtp servers should give us a better idea of where to look for the problem.

Updated flow with cross wire and current logging...

[{"id":"cccf4309.ced1f8","type":"function","z":"d3b91c24.d876f","name":"Me","func":"var slots = msg.topic;\nmsg.topic = \"Octopus slots for \" + slots;\nmsg.payload = global.get(\"expensive\")||0;\nmsg.payload += \"\\n\\n\";\nmsg.payload += \"The best times to do stuff are:\";\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute30\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute60\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute90\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute120\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute150\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute180\")||0;\nmsg.payload += \"\\n\";\nmsg.to = \"Octopus CJ<email@example.com>\";\nmsg.from = \"Node Red<nodered@example.com>\";\n\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":160,"wires":[["f4fd1311.a5f57","a643895a.d8bb68"]]},{"id":"ce1ac1a3.bbcb48","type":"cronplus","z":"d3b91c24.d876f","name":"send_eMails","outputField":"topic","timeZone":"","outputs":1,"options":[{"expressionType":"cron","topic":"evening","payload":"1900hrs today to 2300hrs tomorrow","type":"str","expression":"0 0 19 * * *","location":"","offset":"0"},{"expressionType":"cron","topic":"morning","payload":"0800hrs to 2300hrs today","type":"str","expression":"0 0 8 * * *","location":"","offset":"0"}],"x":290,"y":160,"wires":[["4d077160.91e3f8","cccf4309.ced1f8"]]},{"id":"509943da.9c33bc","type":"e-mail","z":"d3b91c24.d876f","server":"smtp.example.com","port":"465","secure":true,"tls":false,"name":"","dname":"","x":650,"y":160,"wires":[]},{"id":"4d077160.91e3f8","type":"function","z":"d3b91c24.d876f","name":"cron_log","func":"var contextname = \"cron_log\";\n\nvar log = flow.get(contextname) || [];\n\nvar logEntry = {\n    msg: RED.util.cloneMessage(msg),\n    time: new Date()\n}\n\nlog.push(logEntry);\n\nflow.set(contextname, log);\n\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":220,"wires":[[]]},{"id":"ad4fee30.a86608","type":"inject","z":"d3b91c24.d876f","name":"","topic":"direct inject","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":420,"wires":[["4b094618.247398"]]},{"id":"11f647e3.7f3388","type":"cronplus","z":"d3b91c24.d876f","name":"send_eMails -2","outputField":"topic","timeZone":"","commandResponseMsgOutput":"output1","outputs":1,"options":[{"expressionType":"cron","topic":"morning","payload":"morning payload","type":"str","expression":"0 59 7 * * *","location":"","offset":"0"},{"expressionType":"cron","topic":"evening","payload":"evening payload","type":"str","expression":"0 59 19 * * *","location":"","offset":"0"}],"x":280,"y":480,"wires":[["4b094618.247398"]]},{"id":"4b094618.247398","type":"function","z":"d3b91c24.d876f","name":"","func":"var slots = msg.topic;\nmsg.topic = \"Octopus slots for \" + slots;\nmsg.payload = global.get(\"expensive\")||0;\nmsg.payload += \"\\n\\n\";\nmsg.payload += \"The best times to do stuff are:\";\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute30\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute60\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute90\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute120\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute150\")||0;\nmsg.payload += \"\\n\";\nmsg.payload += global.get(\"minute180\")||0;\nmsg.payload += \"\\n\";\nmsg.to = \"Colin CJ<testcj@example.com>\";\nmsg.from = \"Node Red<test@example.com>\";\n\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":480,"wires":[["509943da.9c33bc","4741abd4.fc3874"]]},{"id":"f4fd1311.a5f57","type":"e-mail","z":"d3b91c24.d876f","server":"smtp.otherserver.com","port":"587","secure":false,"tls":false,"name":"","dname":"","x":710,"y":480,"wires":[]},{"id":"a643895a.d8bb68","type":"function","z":"d3b91c24.d876f","name":"mail1a_log","func":"var contextname = \"mail1a_log\";\n\nvar log = flow.get(contextname) || [];\n\nvar logEntry = {\n    msg: RED.util.cloneMessage(msg),\n    time: new Date()\n}\n\nlog.push(logEntry);\n\nflow.set(contextname, log);\n\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":120,"wires":[[]]},{"id":"4741abd4.fc3874","type":"function","z":"d3b91c24.d876f","name":"mail2a_log","func":"var contextname = \"mail2a_log\";\n\nvar log = flow.get(contextname) || [];\n\nvar logEntry = {\n    msg: RED.util.cloneMessage(msg),\n    time: new Date()\n}\n\nlog.push(logEntry);\n\nflow.set(contextname, log);\n\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":520,"wires":[[]]}]
1 Like

It might be worth while stopping node-red and making quite sure that the email really is coming from there.

1 Like

Good idea.

When I have removed either the cron-plus node, or the email node, the email isn't sent.

I will wait for a couple of days to let things run to eliminate Node Red as far as possible. But I have integrated Node Red so much into the Home Control, I will need to set a reminder a few minutes before the email is sent, stop Node Red and then restart a couple of minutes after and 'we' shall see what happens. :sweat_smile:

In that case I don't think it is a particularly useful idea. If removing the cron node stops it then stopping node-red certainly would.

FYI, Today's observations.

Looked at this mornings emails an still have the phantom.

However, looking at the headers of the emails, something weird is happening! (As if :joy:) Before I start, I have just rechecked and I can assure you that my smtp's are not open relays - even tried to send from outside the Network. But I am getting this from the eMail source (CTRL-U) of the eMails

Valid email
Valid

Phantom
Removed to delete IP address

No unexpected connections to the Network, but the supposed sending IP address is from outside! It doesn't even appear to connect to a valid account in my ISPConfig3 setup (several domains hosted locally). I will need to investigate further.

I do have fixed IP here, hence me blanking the relevant stuff.

I am still working on this and assembling data. I will report back when I have exhausted all options!

At the moment, I don't hold out much hope that I can get to the bottom of this, it is really testing my logical reasoning and at one instance every 24 hours, my patience is being tested!!

Hi,

So, after doing a long series of experiments, I am down to the final action. I am still receiving the phantom email with NO email Node in the Flow. The last remaining part of the flow was the Second email node ONLY - everything else removed! So, my only option now is to delete node-red-node-email 1.7.8 and see what happens, then re-install it.

I vaguely recall doing this in the early days and after the re-install the problem was still apparent, hence my visit here. I just wanted to check if anyone wants anything else checked/done before I do the uninstall/re-install, and how best to completely uninstall it to get rid of this apparent lingering and inconvenient artifact.

If you are interested, the documented steps I took are in the attached image.

Best wishes,
Colin

It would be worth looking at the flow file itself. If I understand correctly you believe that there is now only one node in the file (the email node). I wonder whether actually there is an invisible node there causing the problem. The file should be easy enough to understand, particularly if you enable pretty print in settings.js.
I have difficulty imagining that the email node is sending mail without being instructed to.
Possibly post the file here.