*web/email not working with PxPlus Webserver

Started by Ken Sproul, April 18, 2019, 12:38:29 PM

Previous topic - Next topic

Ken Sproul

I have a PxPlus Webserver background process with a web request program that uses *web/email to send emails from the server.  If I substitute it with *web/mail, the email is sent with no problem.

The message I'm getting from *web/email is:
Sending to SMTP Server Failed: (0): Connect to SMTP Server: unc-address;25 timed out. (0/115).

So why is *web/email having this problem and *web/mail is not?  Any help will be appreciated.
Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

Devon Austen

Hi Ken,

If you are using PxPlus 2016 or newer you can try to use the *web/testemail utility.

CALL "*web/testemail;test_name",from$,smtp_server$,username$,password$,to$

This will allow you to do a very simple test of *web/email. If it works it will display the *web/email command it used. This helps make sure you are calling it correctly. If it doesn't work it lets you know that none of the extra options are to blame.

The difference between the two programs I believe is that *web/email is our full featured email utility while *web/mail is a older simple bare bones utility. It is possible that a difference in how they are implemented is why one works but one doesn't.

The *web/mail program has a 20 second timeout. While *web/email uses whatever timeout you specify. If not specified passed in as 0 then it defaults to 60 seconds. Are you passing in a value to *web/email less than 20 for timeout?
Principal Software Engineer for PVX Plus Technologies LTD.

Ken Sproul

In this case it is not PxPlus 2016.  We actually have another background process on the same server executing the same code that the webserver process is executing and the *web/email call works perfectly in that process.  So it's something different about the webserver process that I cannot figure out.  I'm passing all the same values in the *web/mail call for the equivalent arguments of the *web/email call.  I'm not passing any timeout value to *web/email and it's taking the full 60 seconds to fail based on the time stamps of the logging that we're doing.

This really is perplexing because it's a very simple text/html email with the server address, port 25 specified, from address, reply address same as from, one to address, a subject, and a very short message.  No authentication, ssl, cc addresses, bcc addresses, or attachments.
Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

Devon Austen

I would look at the documentation for *web/email (https://manual.pvxplus.com/?Web%20Utilities/Email%20Utility/Overview.htm) carefully and make sure you are calling it correctly. It is fairly common to get one of the arguments wrong and that can cause issues.

Another possibility is internet security or antivirus software blocking the process from connecting.
Principal Software Engineer for PVX Plus Technologies LTD.

Ken Sproul

The exact same *web/email call works outside of the webserver process.  This exact same code is executed in another background process with no issue. It has something to do with the webserver background environment, just not sure what that could be.  If *web/mail works, *web/email should also work.  It would be nice to know what it is doing differently that would cause the error 0.
Ken Sproul
DPI Information Service, Inc.
Pivotal Systems LLC

Devon Austen

What user is the webserver process being run as? Does that user have the correct firewall settings?
Principal Software Engineer for PVX Plus Technologies LTD.

EVa

The error message indicates that a simple open of "[tcp]unc-address;25" doesn't work (or "[tcp]unc-address;25;secure" if you specified -secure) and results in an error 0.  Can you create a simple web program that tries to do that open ?