Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Configuring SMTP Mail notifier for Statping

    Statping
    3
    14
    854
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • chris
      chris @BrutalBirdie last edited by

      thanks @brutalbirdie for the "teach a man to fish" breakdown of how best to troubleshoot the app add ons and terminal look up for variables.

      I found it helpful. and was able to see the apps SMTP info - HOWEVER, with that info, i was not able to get a successful email out of the app via its SMTP Mail notifier. i tried both ports with and without TLS/SSL.

      as of now i have two primary issues when using statping on cloudron

      1. emails do not appear to be going out
      2. because i am not getting emails, i cant validate a new users email, which means i cant add new users to get notifications.

      Here is the error code (ip masked)
      { "Op": "dial", "Net": "tcp", "Source": null, "Addr": { "IP": "xxx.xxx.xxx.xxx", "Port": 2465, "Zone": "" }, "Err": { "Syscall": "connect", "Err": 111 } }

      BrutalBirdie 1 Reply Last reply Reply Quote 2
      • BrutalBirdie
        BrutalBirdie Staff @chris last edited by

        @chris please open a new topic about this issue and link this topic to it. (and also me if you wish so)
        This way different problems stay separated and also their solutions which makes the solution easier to find in the future.

        Like my work? Consider donating a beer 🍻 Cheers!

        BrutalBirdie 1 Reply Last reply Reply Quote 0
        • BrutalBirdie
          BrutalBirdie Staff @BrutalBirdie last edited by

          Oh I guess this got moved, good to know 😄

          The error code is from the Cloudron Mail tab or from the Statping app?

          Like my work? Consider donating a beer 🍻 Cheers!

          chris 1 Reply Last reply Reply Quote 0
          • chris
            chris @BrutalBirdie last edited by

            @brutalbirdie error is from statping backend when adding (and testing) smtp info:
            image (3).jpg

            girish 1 Reply Last reply Reply Quote 0
            • girish
              girish Staff @chris last edited by

              @chris looks to be some bug in the app. Unfortunately, there are many issues with the app and others have also requested that this app be marked as unstable (https://forum.cloudron.io/topic/4106/mark-this-app-as-unstable/). To add to it, the upstream author is not responding much either about bug reports we raised.

              So, I don't have a good answer other than to not use this app for the moment until we find some time to fix the issues. I am looking into publishing phpservermonitor in the next few days (since @msbt has already packaged it).

              chris 1 Reply Last reply Reply Quote 2
              • chris
                chris @girish last edited by chris

                @girish i got SMTP working when used with SENDGRID, no problem - so i am not sure this particular issue is a bug with the app (seems not).

                Maybe my SMTP settings from cloudron are the issue, any other ideas?

                girish 1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @chris last edited by girish

                  @chris Oh, I just noticed that the SMTP Host is not correct. It should be mail and not my.domain.com. This is because the port 2465 is only exposed internally and not exposed externally.

                  Can you try these and let me know what works (same username and password as above):

                  • SMTP Host: mail and Port 2465
                  • SMTP Host: mail and Port 2525
                  • SMTP Host: my.xx.net and Port 587 <-- I expect this to definitely work since you say sendgrid worked

                  BTW, Where did you get the SMTP Username and Password from? Did you just create a mailbox (if so, that is the correct way) or from the environment variables (this is also correct).

                  chris 2 Replies Last reply Reply Quote 0
                  • chris
                    chris @girish last edited by

                    @girish i followed @BrutalBirdie notes from this forum post

                    running printenv from within terminal to see user/pass/port info. let me try your suggested edits now...

                    1 Reply Last reply Reply Quote 0
                    • chris
                      chris @girish last edited by

                      @girish no luck with any of those 3 approaches. all failed with the app, reverted back to send grid for now.

                      girish 1 Reply Last reply Reply Quote 0
                      • girish
                        girish Staff @chris last edited by

                        @chris thanks for testing. I found the reason why it won't connect to port 587. It's because when a connection is "internal", Cloudron won't offer STARTTLS. This makes Go reject the connection as unencrypted. This is the reason why we had made port 2465 in the first place but that doesn't work for some reason. Debugging...

                        chris 1 Reply Last reply Reply Quote 0
                        • chris
                          chris @girish last edited by

                          @girish thanks for looking deeper into this, hopefully the fix is easy.

                          while testing various SMTP out configs, i also thought i would integrate twilio, i already have twilio accounts, so putting in the Account SID and Token was easy, and worked, but when i put the phone number in and saved, i got an error, status code 422. will open new forum post on this one to keep this one related to SMTP.

                          1 Reply Last reply Reply Quote 0
                          • girish
                            girish Staff last edited by

                            OK, decided to look into this to see if it's something obvious.

                            The testing logic is here https://github.com/statping/statping/blob/1a56afe7f76403ad8f839a45de02b2715370eb6c/notifiers/email.go#L137 which in turn just calls into https://github.com/statping/statping/blob/1a56afe7f76403ad8f839a45de02b2715370eb6c/notifiers/email.go#L155 . By my reading, SSL will be set to false (ApiKey is curious use of some random db field it seems). Which then lands in an unmaintained go module - https://github.com/go-mail/mail/blob/v2/smtp.go . The default for StartTLS in the package is opportunistic - https://github.com/go-mail/mail/blob/v2/smtp.go#L163 , so it should all just work but clearly doesn't 🤔

                            chris 1 Reply Last reply Reply Quote 0
                            • chris
                              chris @girish last edited by

                              Thanks for taking another look into this @girish - the maintainer seems unwilling/unable to address the issue you raised on github. For now using a third party SMTP is working fine with this app (sendgrid) but i would love if this apps twilio support (SMS) support, worked... as its tands i cant get that working either. in any case, looking into the new app on cloudron you just added: https://forum.cloudron.io/category/126/php-server-monitor as it providers similar features.

                              1 Reply Last reply Reply Quote 1
                              • girish
                                girish Staff last edited by girish

                                After much Go code spelunking:

                                5c04aea9-e8fa-4e3b-b04e-06d364506a0b-image.png

                                I guess a fix has to be made to statping but generally I prefer changing the platform to adapt to the app unless it's an outright bug. So, I am going to see if I can fix our mail server.

                                Notes to future me:

                                • statping always sets mailer.SSL to fase. This means port 2465 can never work
                                • Ultimately, go-mail in turn uses net/smtp which won't send passwords with TLS
                                1 Reply Last reply Reply Quote 1
                                • First post
                                  Last post
                                Powered by NodeBB