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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Statping
  3. Configuring SMTP Mail notifier for Statping

Configuring SMTP Mail notifier for Statping

Scheduled Pinned Locked Moved Statping
14 Posts 3 Posters 2.2k Views 3 Watching
  • 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.
  • BrutalBirdieB BrutalBirdie

    Oh I guess this got moved, good to know 😄

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

    chrisC Offline
    chrisC Offline
    chris
    wrote on last edited by
    #4

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

    girishG 1 Reply Last reply
    0
    • chrisC chris

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

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #5

      @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).

      chrisC 1 Reply Last reply
      2
      • girishG girish

        @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).

        chrisC Offline
        chrisC Offline
        chris
        wrote on last edited by chris
        #6

        @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?

        girishG 1 Reply Last reply
        0
        • chrisC 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?

          girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by girish
          #7

          @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).

          chrisC 2 Replies Last reply
          0
          • girishG 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).

            chrisC Offline
            chrisC Offline
            chris
            wrote on last edited by
            #8

            @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
            0
            • girishG 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).

              chrisC Offline
              chrisC Offline
              chris
              wrote on last edited by
              #9

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

              girishG 1 Reply Last reply
              0
              • chrisC chris

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

                girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #10

                @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...

                chrisC 1 Reply Last reply
                0
                • girishG girish

                  @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...

                  chrisC Offline
                  chrisC Offline
                  chris
                  wrote on last edited by
                  #11

                  @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
                  0
                  • girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #12

                    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 🤔

                    chrisC 1 Reply Last reply
                    0
                    • girishG girish

                      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 🤔

                      chrisC Offline
                      chrisC Offline
                      chris
                      wrote on last edited by
                      #13

                      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
                      1
                      • girishG Offline
                        girishG Offline
                        girish
                        Staff
                        wrote on last edited by girish
                        #14

                        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
                        1
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Bookmarks
                        • Search