9 Replies Latest reply on Jan 21, 2014 10:22 AM by NickLightbody

    Problems sending mail by smtp from FM WebDirect?

    NickLightbody

      I have a procedure on our new dApp - sending a prospective new user an automatic email with their account details - which works perfectly when the user is requesting the account from FMPro but fails consistently when they request from FMWebDirect.

      The Sendmail request uses the smtp server option - without connection encryption - with plain password authentication.

      FMServer 13 reports Error Code 1502: Connection refused by smtp server.

      I am speaking to our ISP to try to get them to find the log items that apply.

      Does anyone have knowledge of any possible issue here in FM WebDirect?

       

      Thank you for any suggestions - this is currently preventing our being able to start a public trial.

       

      Cheers, Nick

        • 1. Re: Problems sending mail by smtp from FM WebDirect?
          mikebeargie

          Are you performing it without dialog?

           

          According to this:

          http://www.filemaker.com/13help/en/html/scripts_ref2.37.70.html

           

          WebDirect does not support the no dialog checkbox (or the addition of attachments).

           

          Have you thought about dropping it in a "perform script on server" script to see if you can get it to work there?

          1 of 1 people found this helpful
          • 2. Re: Problems sending mail by smtp from FM WebDirect?
            NickLightbody

            Thanks Mike, that is very helpful and appreciated.

             

            (1) The point that the documentation does not make clear though seems to be that in not supporting SendMail dialogue WebDirect does not support send by smtp - only by local client - or so it appears now trying it.

             

            (2) Futher this non-compatibility is not shown by the compatibility element in the script editor which shows a send by smtp step as compatible.

             

            Yes I will try to Run on Server - will update this thread with the result.

             

            This is clearly a significant limitation as  in order to make it easy for folk to subscribe to a web based service it is pretty tricky if they can't get a credentials email as I had intended.

             

            Cheers, Nick

            • 3. Re: Problems sending mail by smtp from FM WebDirect?
              mikebeargie

              On the flip side, if it IS limited (and not documented), it could also be to prevent malicious spam blasting through WebDirect. Filemaker has been lucky in terms of not having to deal with the brute force, injection and DDoS attacks that most web sites deal with. However I wonder what pushing further into the web space will open up on that front.

               

              I've been playing with a few tools to find something that works like our Script Debugger in Filemaker for actions performed by WebDirect on the client side. I might be putting out a blog post in the future about debugging WebDirect as well.

               

              Good luck, and please let us know your results!

              • 4. Re: Problems sending mail by smtp from FM WebDirect?
                NickLightbody

                Thanks Mike.

                 

                My approach to debugging serverside stuff is to write a script in a common form - ie. self contained using entirely passed parameters - I use Ray Cologon's psuedo xml technique - than use a switch to control whether it is run locally or serverside.

                 

                The second limb is a decent event logging system so that I can capture what is happening in a server side session - remembering that each server side session call always first runs the On Open script.

                 

                Third limb is to work through the errors on the server log and stop them all.

                 

                The most tricky error to sort seems to be that one must remember not to call Run on server from a script which is itself Run on server - such scripts must be called locally by the serverside session.

                 

                Using several automatic switches to control this stuff seems to work for me.

                 

                I have tended to treat the Web Direct stuff in the same way - a means of watching what a Web Direct session was doing would certainly be very interesting.

                 

                Yes I will let you know about the send mail outcome.

                 

                Cheers - Nick

                • 5. Re: Problems sending mail by smtp from FM WebDirect?
                  beverly

                  Repeat 3 times:  WebDirect is WEB. WebDirect is WEB. WebDirect is WEB.

                   

                  Unless you use the db server and/or web apps with these kinds of functions, you may or may not get all that you desire with WebDirect.

                   

                  Learn what it can do. Learn from the developers that are advising you to optimize for WD. Remember always that is a web solution. And peace y'all!

                   

                  -- sent from my iPhone4 --

                  Beverly Voth

                  --

                  • 6. Re: Problems sending mail by smtp from FM WebDirect?
                    mikebeargie

                    Hey Beverly, thanks for chiming in!

                     

                    I think the argument now is basically what is/isn't supported by WebDirect. The official documentation does not state that SMTP send email is not supported, yet it seems to behave that way.

                     

                    With perform script on server, it makes loads of sense to abuse that when you're connecting via web direct. Remember that any client-side actions require loading of all data, then processing, then result. As opposed to server side actions that send the result directly.

                    • 7. Re: Problems sending mail by smtp from FM WebDirect?
                      NickLightbody

                      Mike,

                       

                      FMI have confirmed to me that mail send by smtp is supported under FM WebDirect - send by client without dialogue is not supported. Hence I think I am looking at security bit privileges to make this work - but I still don't yet understand why this works correctly with Pro and iOS clients but not with WebDirect - the answer will doubt less appear now I can be confident that it should work.

                      Cheers - Nick

                      • 8. Re: Problems sending mail by smtp from FM WebDirect?
                        NickLightbody

                        As a further note on this one - having tried the same procedure on our US and UK servers - here is what worked and didn't work:

                         

                        US Server: Windows:

                        FMPro: smtp local = OK

                        FM WebDirect: smtp local = fail error 1502

                        FMPro: smtp exec on SVR = fail error 1502

                        FM WebDirect: smtp exec on SVR = fail error 1502

                         

                        UK Server: OSX 10.8.5:

                        FMPro: smtp local = OK

                        FM WebDirect: smtp local = OK

                        FMPro: smtp exec on SVR = OK

                        FM WebDirect: smtp exec on SVR = OK

                         

                        As the failures are error 1502  "connection refused by SMTP Server"

                        the reason appears to likely be one of:

                         

                        (1) [ISP Filtering] that our ISP is rejecting perfectly proper smtp traffic from our US Server

                        or

                        (2) [FMS Hosting] that our US Server is doing something odd which results in our ISP rejecting the traffic

                        or

                        (3) [FMS Hosting on Windows] there is an issue with the Windows side of things

                         

                        or perhaps you have some insight into this?

                         

                        As our UK server is sitting in our ISP's rack perhaps option (2) is slightly more likely?

                         

                        So external causes - but not proving easy to isolate

                         

                        Cheers - Nick

                        • 9. Re: Problems sending mail by smtp from FM WebDirect?
                          NickLightbody

                          The underlying answer is that our US Hosting company has a block on smtp in their perimeter firewall - so that provided you ask for the relevant port - say 587 - to be opened to traffic with the IP of your own mail server - then you are in the clear.

                           

                          I am surprised that this was the case as I would have thought that the ability to use smtp was pretty fundimental to running a FMServer - clealry not as widely a shared view as I had thought - so one just needs to ask!

                           

                          Cheers - Nick

                          1 of 1 people found this helpful