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
  • Brite
  • 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 - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. PocketBase
  3. Email for pocketbase

Email for pocketbase

Scheduled Pinned Locked Moved PocketBase
21 Posts 6 Posters 576 Views 6 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.
  • jamesJ Online
    jamesJ Online
    james
    Staff
    wrote on last edited by
    #3

    Hello @jesperbllnbm
    Due to the way PocketBase is developed it can not connect internally to STARTTLS without the certs.
    This works for mosts apps, but some don't like it.
    PocketBase is requiring a valid mail server certificate to send email internally, thus 2587 is used.

    1 Reply Last reply
    1
    • JesperBllnbmJ Offline
      JesperBllnbmJ Offline
      JesperBllnbm
      wrote on last edited by
      #4

      Wow such a quick response time! Thanks that cleared it 👍

      1 Reply Last reply
      2
      • jamesJ Online
        jamesJ Online
        james
        Staff
        wrote on last edited by
        #5

        Hello @jesperbllnbm
        Always happy to help.

        1 Reply Last reply
        0
        • JesperBllnbmJ Offline
          JesperBllnbmJ Offline
          JesperBllnbm
          wrote on last edited by
          #6

          Hi @James - I do have 1 more question. Is it normal that the container restart (stop->start, using the cloudron dashboard) resets the email port? After a restart I am back to 587, is there a way to persist this configuration?

          Thanks in advance!

          1 Reply Last reply
          0
          • jamesJ Online
            jamesJ Online
            james
            Staff
            wrote on last edited by
            #7

            Hello @jesperbllnbm
            I will look into it.

            1 Reply Last reply
            0
            • jamesJ Online
              jamesJ Online
              james
              Staff
              wrote on last edited by
              #8

              Hello @jesperbllnbm
              I was able to reproduce this issue.
              An app update will be avaible soon to fix the issue.

              1 Reply Last reply
              1
              • nebulonN Away
                nebulonN Away
                nebulon
                Staff
                wrote on last edited by
                #9

                The new package is out

                1 Reply Last reply
                4
                • JesperBllnbmJ Offline
                  JesperBllnbmJ Offline
                  JesperBllnbm
                  wrote on last edited by
                  #10

                  😍 amazing turn around time

                  1 Reply Last reply
                  1
                  • V Online
                    V Online
                    Valexico
                    wrote last edited by
                    #11

                    Hi
                    I don't succeed to make pocketbase work with cloudron SMTP
                    I always end up with timeout errors

                    What am I missing

                    e2f68925-5623-428b-ae7f-026518a260f9-image.jpeg

                    1 Reply Last reply
                    0
                    • V Online
                      V Online
                      Valexico
                      wrote last edited by Valexico
                      #12

                      Hmm it appears that when sending test email, pocketbase is showing timeout but after a while I do receive the test email in my inbox.
                      This slow response also make login very slow because pocketbase is trying to sen email alerts. I am not sure where can be the problem.

                      From pocketbase point of view, the email request gave timeout
                      From user point of view the login time is slow (~30 seconds maybe) -> workround : disable login alerts
                      But emails do get sent at the end ? At least test emails

                      1 Reply Last reply
                      2
                      • jamesJ Online
                        jamesJ Online
                        james
                        Staff
                        wrote last edited by
                        #13

                        Hello @valexico
                        Thanks for reporting this.
                        I am looking into it.

                        1 Reply Last reply
                        2
                        • jamesJ Online
                          jamesJ Online
                          james
                          Staff
                          wrote last edited by
                          #14

                          This behaviour is very odd.
                          Sometimes it sends, sometimes it does not, but always the send test email times out.
                          As if there is an internal event / cron handler that does not work correctly and only if you hit the perfect time frame to send a test mail it actually sends

                          Many times it fails the send test mail only to send the mail after the failed attempt anyway.
                          I observed this in the mail service logs and the debug log of pocketbase.

                          There must be something going in internally that is creating this issue.

                          37698875-3502-4bda-b362-daca9fce651c-image.jpeg

                          1 Reply Last reply
                          0
                          • robiR Offline
                            robiR Offline
                            robi
                            wrote last edited by
                            #15

                            Could it be hitting throttling limits?

                            Conscious tech

                            jamesJ 1 Reply Last reply
                            0
                            • robiR robi

                              Could it be hitting throttling limits?

                              jamesJ Online
                              jamesJ Online
                              james
                              Staff
                              wrote last edited by
                              #16

                              Hello @robi

                              The Cloudron mail server was not throttling, I ensured that.

                              robiR 1 Reply Last reply
                              0
                              • jamesJ james

                                Hello @robi

                                The Cloudron mail server was not throttling, I ensured that.

                                robiR Offline
                                robiR Offline
                                robi
                                wrote last edited by
                                #17

                                @james I was thinking fw not mail.

                                Next thing would be to see what the code does

                                Conscious tech

                                1 Reply Last reply
                                0
                                • jamesJ Online
                                  jamesJ Online
                                  james
                                  Staff
                                  wrote last edited by
                                  #18

                                  Hello @jesperbllnbm

                                  This is/was a very complex issue to figure out.

                                  TL;DR - "fix" or workaround

                                  Renaming your mail domain from my to e.g.: mail in /#/email-settings will resolve this issue. (be sure to also update your PTR/rDNS record)

                                  Changing the port from 2587 to 587 also works when incoming mails for your Cloudron server is enabled.
                                  Warning, changing just the port in pocketbase will not be permanent, since every app restart will configure 2587 again.

                                  Detailed report

                                  Pocketbase is a golang application.
                                  If CGO_ENABLED=0 is set for the build it will result in Go uses its own built-in resolver.
                                  While designed to mimic the system, it has known edge cases where it might skip /etc/hosts and rely entirely on DNS.

                                  Certain hosting providers, like DigitalOcean, will set the name for the server in the /etc/hosts file.
                                  So if you name your server my.cloudron.dev DigitalOcean will create a record in the /etc/hosts file with my.cloudron.dev 127.0.0.1, which will result into DNS queries asking for my.cloudron.dev to answer with 127.0.0.1.
                                  If this is not handled by Cloudron certain things would not work.
                                  For example, if you'd use the N8N Cloudron app to run API calls against your own Cloudron server, it would resolve my.cloudron.dev to 127.0.0.1 and fail.

                                  This is why we have a line of code to prevent this issue - https://git.cloudron.io/platform/box/-/blob/v9.1.6/src/docker.js?ref_type=tags#L716

                                  if (manifest.id !== 'com.adguard.home.cloudronapp') containerOptions.HostConfig.ExtraHosts.push(`${dashboardFqdn}:172.18.0.1`);
                                  

                                  to always resolve the dashboard FQND to 172.18.0.1 which is the docker proxy / docker bridge inside the docker containers, except for the AdGuard app.

                                  But now, something specific can happen.
                                  The golang mail client requires the mail host to match the mail domain for StartTLS validation.
                                  That is why we have the requiresValidCertificate flag for the sendmail addon for Cloudron apps to handle apps that need valid certificates for mailing.
                                  With requiresValidCertificate set to false (the default), the CLOUDRON_MAIL_SMTP_SERVER variable inside the docker containers will be mail which works for most apps.
                                  With CLOUDRON_MAIL_SMTP_SERVER set truethe CLOUDRON_MAIL_SMTP_SERVER will be the mail domain, by default my.DOMAIN.TLD so for me my.cloudron.dev.

                                  For pocketbase, Go uses its own built-in resolver, it now resolves my.cloudron.dev not to 172.18.0.1 but to the public IPv4/IPv6 139.162.188.66/2a01:7e01::2000:3cff:fe7c:9d41 and tries to connect with port 2587 which fails, because port 2587 is only open internally.
                                  So at some point the failing connection times out and Go's will try to resolve my.cloudron.dev not with its internal resolver but from the system, which then sends the mail.
                                  This explains why the test mail is sent after some time, even tho it reports a timeout and fail.

                                  We are looking deeper into this to find a solution that covers these edge cases to prevent such issues in the future.
                                  The roads of DNS can be a harsh journey to navigate.

                                  1 Reply Last reply
                                  1
                                  • jamesJ Online
                                    jamesJ Online
                                    james
                                    Staff
                                    wrote last edited by
                                    #19

                                    We found a solution and this will be part of the next Cloudron release.

                                    1 Reply Last reply
                                    0
                                    • V Online
                                      V Online
                                      Valexico
                                      wrote last edited by
                                      #20

                                      Thank you for your work on this. It was a hard one...
                                      Any idea of the timing of this next release ? Are you speaking of a major release ?

                                      jamesJ 1 Reply Last reply
                                      0
                                      • V Valexico

                                        Thank you for your work on this. It was a hard one...
                                        Any idea of the timing of this next release ? Are you speaking of a major release ?

                                        jamesJ Online
                                        jamesJ Online
                                        james
                                        Staff
                                        wrote last edited by
                                        #21

                                        Hello @valexico

                                        @Valexico said:

                                        Are you speaking of a major release ?

                                        No, the next minor release will include this fix.
                                        Until then, you can either set the port in pocketbase to 587 if incoming fails is enabled on your Cloudron. (not persistent across restarts)
                                        Or you change the mail domain from my to e.g. mail. (persistent across restarts)

                                        1 Reply Last reply
                                        0

                                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                        With your input, this post could be even better 💗

                                        Register Login
                                        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