boliva Posted August 16 Share Posted August 16 I am using script to setup an email queue. If the email fails to send, the script will automatically retry periodically until it either succeeds or a set amount of time has passed. I have a site with a VERY SLOW cellular network connection and am noticing that I am getting duplicate emails. When I look at a local log onsite (I'm logging errors), I see the two error messages 80040209: Unexpected End of Message response, Last Response: & 80072746: An existing connection was forcibly closed by the remote host. I only get this on this slow connection and the emails are actually coming across because I'm getting many duplicates over time. Any ideas why this occurs and/or a method to add a delay or wait in knowing that it may be a SLOW network to fix this? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted August 16 Share Posted August 16 Does it generate multiples if you just do a single send call from DAQFactory without any retries? I'd first check to see if the problem is essentially echoing, where the remote site gives up and tries again and generates an error but the message actually got through enough for the server to process. This retry could be happening at a lower level than your script / DAQFactory which is why I ask if it generates multiples from a single call. The default timeout for outgoing email at a lower level is 60 seconds. At present we don't expose this so you can't edit it, but we could make this available if it comes to it. Quote Link to comment Share on other sites More sharing options...
boliva Posted August 16 Author Share Posted August 16 Based on the times that the second and/or third email comes through, it looks like its from the retry (about 600 seconds apart based on a setting within the script). Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted August 17 Share Posted August 17 So are you not getting an error from the first try? Are you using the object form of the emailer or the generic email. version? The object form blocks by default, but the generic email. is async and runs in the background so is difficult to error handle. Quote Link to comment Share on other sites More sharing options...
boliva Posted August 17 Author Share Posted August 17 I'm using the object form. I am getting errors on the first try, but 600 seconds later, receive a duplicate copy. Sometimes this continues quite often and I get many duplicate copies. This ONLY occurrs when I have a very slow network connection (weak cell signal). All emails appear to come through but I get the errors mentioned above. I couldn't find anything when I googled those error numbers so was thinking it was a Windows local thing vs email server side? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted August 17 Share Posted August 17 Right, but is your script triggering a second try 600 seconds later? Or do you stop trying once receiving the error and for some reason you get duplicates 600 seconds later without anything from DAQFactory? Quote Link to comment Share on other sites More sharing options...
boliva Posted August 17 Author Share Posted August 17 sorry, yes, my script is triggering the retry 600 seconds later. The retry is built to continue every 600 seconds if a failed attempt is detected for a period of 2-days. I know coverage is spotty where the site is and want to get the information from the system. There are times where the emails actually fail, but come across later, but these are succeeding, and still being held in script and retried. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted August 17 Share Posted August 17 So you aren't getting an error from the first send and it is sending another 600 seconds later, but the first send is actually going through? Quote Link to comment Share on other sites More sharing options...
boliva Posted August 17 Author Share Posted August 17 I'm getting an error on each send, but they're still going through. The retry occurs because the error was received. The errors received are the two mentioned at the top of this thread. Maybe those errors need to be ignored? Those don't look like SMTP errors but rather Windows based errors I'm assuming? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted August 18 Share Posted August 18 Yes, those look like errors that Windows is generating because it is loosing connection with the server at the last moment. I still believe it is a case of the message getting through, but the ack from the server is not making it back. So the email goes out, but Windows times out waiting for the ack that the email was sent and never gets it, or gets an unexpected response and throws an error. The problem is that you likely would get the same error if the connection was lost earlier in the process and the email wasn't sent. So, I don't think you can just ignore the error if you have to get the email out. Truthfully, I would probably look to other things if you need to make sure you get the email and you don't want to get repeats. But do remember that email delivery isn't guaranteed no matter what, so shouldn't be relied upon as the end all be all of alarming notification. That said, a few choices for you: 1) use a tool like DAQConnect. This tool uses a different method for posting data with less handshaking and so might work better than old email. It also has the ability to generate lost connection alerts. But there is a monthly fee involved (very small for a few points) 2) use something else similar to DAQConnect that uses a simple TCP connection, maybe just spin your own. It is not difficult. You could even put DAQFactory on a public IP and just listen for a very short message code to indicate an alarm (along with some encoding) and then send the email from there. Or, use a very simple webserver. Again, the trick is to reduce the amount of data to an absolute minimum and let the server generate the more verbose message. 3) try a different carrier. We maintain two cell phones on different carriers to ensure that we have reception in all areas. It is not just coverage, but saturation as some of the more remote sites, where only one tower can be reached, get saturated with lots of users during certain events. 4) use old fashion dial up or some other, non-cellular technique (pigeons? ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.