Sequence.
Don’t mind the mess… I will clean up in the function nodes and all that. I just trying to get something out of it as it is now. But on the positive side, it works with two carriers
[{“id”:”df9e7d98.0ad43″,”type”:”inject”,”z”:”ebaa69a9.649708″,”name”:””,”props”:[{“p”:”payload”},{“p”:”topic”,”vt”:”str”}],”repeat”:””,”crontab”:””,”once”:false,”onceDelay”:0.1,”topic”:””,”payload”:”true”,”payloadType”:”bool”,”x”:110,”y”:460,”wires”:[[“310c26fe.f97bca”,”7edac5a0.2a0e3c”]]},{“id”:”7edac5a0.2a0e3c”,”type”:”e-mail in”,”z”:”ebaa69a9.649708″,”name”:””,”protocol”:”IMAP”,”server”:”imap.one.com”,”useSSL”:true,”port”:”993″,”box”:”INBOX”,”disposition”:”None”,”criteria”:”ALL”,”repeat”:”300″,”fetch”:”trigger”,”inputs”:1,”x”:230,”y”:520,”wires”:[[“e695d4bd.06b358”]]},{“id”:”e695d4bd.06b358″,”type”:”function”,”z”:”ebaa69a9.649708″,”name”:””,”func”:”var d = new Date(); nd.setMinutes(d.getMinutes() – 6);nnmsg.tid = Date.parse(msg.date);nmsg.tidnu = d.getTime();nn/*if(parseInt(msg.tid) > msg.tidnu){n msg.message = “start”;n}else{n msg.message = “stop”;n}nnif(msg.from == “noreply@bixia.se”){n msg.message = “stop”;n}*/nvar match =[];nmatch = msg.topic.match(/paket på väg|paket från|spåra di|leverans/i);nif(match !== null){n msg.message = “start”; n}else{n msg.message = “stop”;n}n/*nif(msg.from == “no_reply@bring.se”){n msg.message = “start”;n}else{n msg.message = “stop”;n}*/nreturn msg;”,”outputs”:1,”noerr”:0,”initialize”:””,”finalize”:””,”x”:380,”y”:440,”wires”:[[“e56641fe.45dae”]]},{“id”:”e56641fe.45dae”,”type”:”switch”,”z”:”ebaa69a9.649708″,”name”:””,”property”:”message”,”propertyType”:”msg”,”rules”:[{“t”:”neq”,”v”:”stop”,”vt”:”str”}],”checkall”:”true”,”repair”:false,”outputs”:1,”x”:530,”y”:460,”wires”:[[“baf947f7.a62cc8”]]},{“id”:”baf947f7.a62cc8″,”type”:”function”,”z”:”ebaa69a9.649708″,”name”:””,”func”:”var match = [];nif(msg.from == “no_reply@bring.se”){n match = msg.topic.match(‘Paket från Bring: (.*)’)n}else{n match = msg.html.match(/(d{20})/);n if(match === null){n match = msg.html.match(/d{11}w{2}/);n }n}nmsg.tracking = match;nnreturn msg;”,”outputs”:1,”noerr”:0,”initialize”:””,”finalize”:””,”x”:660,”y”:520,”wires”:[[“777caa3e.1ec134”]]},{“id”:”777caa3e.1ec134″,”type”:”debug”,”z”:”ebaa69a9.649708″,”name”:””,”active”:true,”tosidebar”:true,”console”:false,”tostatus”:false,”complete”:”true”,”targetType”:”full”,”statusVal”:””,”statusType”:”auto”,”x”:790,”y”:480,”wires”:[]}]