Page 1 of 1

Upload report to webserver, no success

Posted: Thu Dec 09, 2021 10:35 pm
by gmartau
I setup the script on the webserver (script was fixed and the username/password was set), I enabled the option in madexcept settings, however the username and password do not validate, only the script path. I built the exe and raised the exception in the program. When pressing the send bug report button, the browser is launched that ask me for username and password.

How is supposed to work? My intuition is that the browser should not be involved. I modified the script to verify if the user/passwd are validated and the browser ask to save the login information so the autentication is successful using the browser. It appears that the script doesn't receive any atachments. So I removed the atachment check. However, the problem persisted, the variables MailSubject/MailBody are not set. In the end, I guess that something is wrong with the way the script is called.

Re: Upload report to webserver, no success

Posted: Fri Dec 10, 2021 8:10 am
by madshi
The browser opens? There's an undocumented option exported by madExcept.pas:

Code: Select all

var
  FollowRedirect : boolean = true;   // automatically open web browser when HTTP upload returns redirect request
Does the browser still open if you set this to "false"? If not, then that means that your browser seems to reply to the HTTP upload request by asking for a redirect request, for some reason (server reply code 301..303, while 500 indicates an error).

You can check which redirect URL the server requested by checking this variable exported by madExcept.pas, after you attempted to upload a bug report:

Code: Select all

var
  LastRedirectURL : AnsiString = '';     // always contains the last HTTP upload redirect request
On a side note, please don't use http:// or https:// in front of the web server address that you enter in the madExcept settings dialog. In the settings dialog, do you get a checkmark or an exclamation warning triangle for the web server address?

Re: Upload report to webserver, no success [solved]

Posted: Fri Dec 10, 2021 11:41 am
by gmartau
I had on the website redirect from http to https for everything so I remove it for testing. Now the validation of the script url fails with question mark disabled and login information as exclamation mark. With https redirection, before, the script url validated with check. However, the executable send the bug report successfuly (with attachment disabled). The encrypt SSL/--- option do not change the behavior for validation or for sending the report.

I enabled the attachment and the exe fails to send the report. I found the php error on the website log that the Function get_magic_quotes_runtime() is deprecated in class.phpmailer.php. I removed those lines and now the report is sent successfuly with atachment.

Finally the script works and the validation from the settings is less than useful. I suggest a button for immediate manual verification with a clear respose code and message (script return code?) to help the debugging.

The exception dialog should be friendly with vcl styles. Dark styles makes the dialog hard to read (owner draw option do no make any difference).

Re: Upload report to webserver, no success

Posted: Fri Dec 10, 2021 12:00 pm
by madshi
Glad to hear you it solved. Sadly, every webserver reacts a bit differently and getting the mailing PHP to work correctly isn't always easy.

About the dialog: madExcept doesn't use VCL at all, because the dialog has to be thread safe, and the VCL is not thread safe, sadly. So madExcept creates the dialog painfully using pure win32 APIs. That makes it a bit harder to make it work well with different styles. But it should be possible somehow, of course. One thing you could do is to replace the dialog with your own dialog. You can even use VCL for that, but then showing your own dialog would only work as long as the main thread is still reacting. Otherwise, the madExcept dialog would be shown again.