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.1k 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

      I could simply tell you how, but I would like to use this as education. (Sorry it hit you :D)

      Where can I find X Information about app Y?

      First of all the doc of the app.
      In your example: https://docs.cloudron.io/apps/statping/

      This doc did not help. What now?

      Lets go deeper. You know you want the SMTP Setting for the app.
      Well let's check out the app on gitlab: https://git.cloudron.io/cloudron/statping-app

      Every Cloudron app has a CloudronManifest.json lets take a look at the CloudronManifest.json|

      {
        "id": "com.statping.cloudronapp",
        "version": "1.0.0",
        "title": "Statping",
        "tagline": "Web and App Status Monitoring",
        "website": "https://statping.com/",
        "contactEmail": "support@cloudron.io",
        "author": "Statping developers",
        "healthCheckPath": "/health",
        "configurePath": "/dashboard",
        "tags": [ "monitor", "ping", "status", "uptime" ],
        "httpPort": 8080,
        "addons": {
          "localstorage": {},
          "postgresql": {},
          "sendmail": {}
        },
        "mediaLinks": [
          "https://screenshots.cloudron.io/com.statping.cloudronapp/statping01.png",
          "https://screenshots.cloudron.io/com.statping.cloudronapp/statping02.png"
        ],
        "changelog": "file://CHANGELOG",
        "description": "file://DESCRIPTION.md",
        "manifestVersion": 2,
        "postInstallMessage": "file://POSTINSTALL.md",
        "minBoxVersion": "5.4.0",
        "capabilities": [ "ping" ],
        "forumUrl": "https://forum.cloudron.io/category/92/statping",
        "documentationUrl": "https://docs.cloudron.io/apps/statping",
        "icon": "file://logo.png"
      }
      

      We can get from this that the addons: localstorage, postgresql and sendmail is used.

      Let's go back to https://docs.cloudron.io/ and put addons in the search, leads to this https://docs.cloudron.io/custom-apps/addons/ where we can view the sendmail addon docs.

      sendmail

      The sendmail addon can be used to send email from the application.

      Exported environment variables:

      CLOUDRON_MAIL_SMTP_SERVER=     # the mail server (relay) that apps can use. this can be an IP or DNS name
      CLOUDRON_MAIL_SMTP_PORT=       # the mail server port. Currently, this port disables TLS and STARTTLS.
      CLOUDRON_MAIL_SMTPS_PORT=      # SMTPS server port.
      CLOUDRON_MAIL_SMTP_USERNAME=   # the username to use for authentication
      CLOUDRON_MAIL_SMTP_PASSWORD=   # the password to use for authentication
      CLOUDRON_MAIL_FROM=            # the "From" address to use
      CLOUDRON_MAIL_DOMAIN=          # the domain name to use for email sending (i.e username@domain)
      

      These are variables which can be echoed in the app web-terminal.
      So go to your app web-terminal and do:

      echo CLOUDRON_MAIL_SMTP_SERVER
      

      You can redo this step for each variable or do:

      printenv | grep -i CLOUDRON_MAIL
      
      chrisC Offline
      chrisC Offline
      chris
      wrote on last edited by
      #1

      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 } }

      BrutalBirdieB 1 Reply Last reply
      2
      • chrisC chris

        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 } }

        BrutalBirdieB Offline
        BrutalBirdieB Offline
        BrutalBirdie
        Partner
        wrote on last edited by
        #2

        @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 drink. Cheers!

        BrutalBirdieB 1 Reply Last reply
        0
        • BrutalBirdieB BrutalBirdie

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

          BrutalBirdieB Offline
          BrutalBirdieB Offline
          BrutalBirdie
          Partner
          wrote on last edited by
          #3

          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 drink. Cheers!

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