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. Support
  3. Forward emails to remote SMTP server

Forward emails to remote SMTP server

Scheduled Pinned Locked Moved Unsolved Support
email
17 Posts 6 Posters 3.6k Views 7 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.
  • B binary1zero

    Folks,

    I'm running a Cloudron instance in DigitalOcean which is working great. My use case requires that Cloudron receive all inbound traffic and then forward all (or selected) mailboxes to a remote SMTP server (not an email) which has more storage etc...

    I wasn't able to find any feature like this. Can someone confirm if it is possible at all ?

    E.g.

    Inbound email (to: user@domain.com) -> Cloudron @ DO -> Internal SMTP Server with bigger storage.

    Outbound email (from: user@domain.com) -> Cloudron @ DO -> Internet

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

    @binary1zero mails are usually stored on IMAP servers and not SMTP servers. So, your internal server will have both SMTP and IMAP ? How do you plan to access incoming emails ?

    B 1 Reply Last reply
    0
    • girishG girish

      @binary1zero mails are usually stored on IMAP servers and not SMTP servers. So, your internal server will have both SMTP and IMAP ? How do you plan to access incoming emails ?

      B Offline
      B Offline
      binary1zero
      wrote on last edited by
      #3

      @girish yes it would have both (another Cloudron or Synology mail server). Plan is users will reach out to Synology directly.

      girishG 1 Reply Last reply
      0
      • B binary1zero

        @girish yes it would have both (another Cloudron or Synology mail server). Plan is users will reach out to Synology directly.

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

        @binary1zero there is no built-in solution for forwarding to another email server.

        This is indeed an interesting request though. I guess this allows a setup where the mail is actually stored at home? Also, if the server is at home, how will you access email when outside? Does this mean you will have the home server partially exposed to the world for mail access? In addition, on many ISPs, inbound port 25 is blocked (yes, even inbound, like in comcast).

        B 1 Reply Last reply
        0
        • robiR Offline
          robiR Offline
          robi
          wrote on last edited by robi
          #5
          • mail forwarding can be configured if the internal mail server has a different domain and has open ports.
          • one could set up a private tunnel / vpn between the two and shuffle mail over to that non routing IP/domain.

          The more robust approach may be to have mail backups be exported to a private Minio instance or similar. (also set up mail pruning on the DO side after some size limit)

          @binary1zero
          Can you elaborate more on this use case, as there may be a more effective way of accomplishing the need, without using SMTP for example which isn't optimal for something like this.

          Emails are relatively small, so if storage is an issue, that may be an overloaded use of the protocol for which better options exist.

          Conscious tech

          1 Reply Last reply
          1
          • B binary1zero

            Folks,

            I'm running a Cloudron instance in DigitalOcean which is working great. My use case requires that Cloudron receive all inbound traffic and then forward all (or selected) mailboxes to a remote SMTP server (not an email) which has more storage etc...

            I wasn't able to find any feature like this. Can someone confirm if it is possible at all ?

            E.g.

            Inbound email (to: user@domain.com) -> Cloudron @ DO -> Internal SMTP Server with bigger storage.

            Outbound email (from: user@domain.com) -> Cloudron @ DO -> Internet

            timconsidineT Offline
            timconsidineT Offline
            timconsidine
            App Dev
            wrote on last edited by timconsidine
            #6

            @binary1zero interesting scenario
            Not sure I understand benefits of this approach, because if it is "just" a question of addressing storage of old emails, my instinct is to think about solutions like :

            • MailPiler (custom package available for Cloudron)
            • MailSteward (proprietary paid but affordable and solid local archiving solution)
            • imapfilter (https://github.com/lefcha/imapfilter) to suck out emails and move them to storage location
            • offlineimap (http://www.offlineimap.org/ and https://www.dermitch.de/post/imap-backup-with-offlineimap/)
            • various "server-suck-file-save" scripts

            Maybe I am missing something in your plan but these could be simpler to implement.

            EDIT : could a sieve filter work to forward all incoming email to another server ? Then just delete/purge periodically on initial receiving server after a time period.

            B 1 Reply Last reply
            3
            • girishG girish

              @binary1zero there is no built-in solution for forwarding to another email server.

              This is indeed an interesting request though. I guess this allows a setup where the mail is actually stored at home? Also, if the server is at home, how will you access email when outside? Does this mean you will have the home server partially exposed to the world for mail access? In addition, on many ISPs, inbound port 25 is blocked (yes, even inbound, like in comcast).

              B Offline
              B Offline
              binary1zero
              wrote on last edited by
              #7

              @girish said in Forward emails to remote SMTP server:

              @binary1zero there is no built-in solution for forwarding to another email server.

              This is indeed an interesting request though. I guess this allows a setup where the mail is actually stored at home? Also, if the server is at home, how will you access email when outside? Does this mean you will have the home server partially exposed to the world for mail access? In addition, on many ISPs, inbound port 25 is blocked (yes, even inbound, like in comcast).

              Exactly what you said. Plan is to run Cloudron/or other mail server on my Synology at home which has ample amount of storage but since ISP cannot give PTR and other settings - I'm using DigitalOcean droplet with Cloudron for my incoming mail (and it works beautifully).

              However, it's expensive to store big mailboxes in cloud. So idea is to receive email via cloudron but forward to downstream mail server at home. Home mail server will be exposed enough to access via IMAP etc.. and it will relay all outbound emails via Droplet/Cloud.

              1 Reply Last reply
              0
              • timconsidineT timconsidine

                @binary1zero interesting scenario
                Not sure I understand benefits of this approach, because if it is "just" a question of addressing storage of old emails, my instinct is to think about solutions like :

                • MailPiler (custom package available for Cloudron)
                • MailSteward (proprietary paid but affordable and solid local archiving solution)
                • imapfilter (https://github.com/lefcha/imapfilter) to suck out emails and move them to storage location
                • offlineimap (http://www.offlineimap.org/ and https://www.dermitch.de/post/imap-backup-with-offlineimap/)
                • various "server-suck-file-save" scripts

                Maybe I am missing something in your plan but these could be simpler to implement.

                EDIT : could a sieve filter work to forward all incoming email to another server ? Then just delete/purge periodically on initial receiving server after a time period.

                B Offline
                B Offline
                binary1zero
                wrote on last edited by
                #8

                @timconsidine said in Forward emails to remote SMTP server:

                EDIT : could a sieve filter work to forward all incoming email to another server ? Then just delete/purge periodically on initial receiving server after a time period.

                I've looked into this but it doesn't seems to be an option. Sieve filter can only redirect to another "email" rather than a mail server. In this case - both emails would be same as we are just forwarding it to a remote mailbox.

                1 Reply Last reply
                1
                • B Offline
                  B Offline
                  binary1zero
                  wrote on last edited by
                  #9

                  Another question is that can I even use Cloudron as a "relay server" from downstream server ? I wasn't able to find any option to whitelist IP or any other way apart from authenticating users at cloudron for outbound emails.

                  1 Reply Last reply
                  0
                  • infogulchI Offline
                    infogulchI Offline
                    infogulch
                    wrote on last edited by
                    #10

                    Previous discussion on the topic:

                    https://forum.cloudron.io/topic/6046/proxy-email-via-vps/9

                    B 1 Reply Last reply
                    2
                    • infogulchI infogulch

                      Previous discussion on the topic:

                      https://forum.cloudron.io/topic/6046/proxy-email-via-vps/9

                      B Offline
                      B Offline
                      binary1zero
                      wrote on last edited by
                      #11

                      @infogulch Thank you that was insightful.

                      Outbound is answered via that post.

                      For inbound, here's what I'm thinking now :

                      • Setup private wireguard connection between DO and my home server
                      • Turn off Inbound email on DO Cloudron.
                      • Redirect inbound ports like TCP/25 via iptables on DO to home server via wireguard
                      mehdiM 1 Reply Last reply
                      2
                      • B binary1zero

                        @infogulch Thank you that was insightful.

                        Outbound is answered via that post.

                        For inbound, here's what I'm thinking now :

                        • Setup private wireguard connection between DO and my home server
                        • Turn off Inbound email on DO Cloudron.
                        • Redirect inbound ports like TCP/25 via iptables on DO to home server via wireguard
                        mehdiM Offline
                        mehdiM Offline
                        mehdi
                        App Dev
                        wrote on last edited by
                        #12

                        @binary1zero From the constraints you mentioned, I do not understand why you don't simply use the home server as a main email server, but with an external relay for outgoing email (assuming your ISP does not block inbound 25).

                        From what I know, PTR and stuff is only necessary for outbound relay, as it mostly affects server reputation when other server decide incoming email is spam.

                        infogulchI girishG 2 Replies Last reply
                        2
                        • mehdiM mehdi

                          @binary1zero From the constraints you mentioned, I do not understand why you don't simply use the home server as a main email server, but with an external relay for outgoing email (assuming your ISP does not block inbound 25).

                          From what I know, PTR and stuff is only necessary for outbound relay, as it mostly affects server reputation when other server decide incoming email is spam.

                          infogulchI Offline
                          infogulchI Offline
                          infogulch
                          wrote on last edited by infogulch
                          #13

                          @mehdi iirc, one signal used to detect spam is whether the inbound and outbound IPs are the same. Maybe this is not the case, but Google and Microsoft are pretty finicky about email delivery so my instinct is to keep the externally visible configuration 'clean'. That's why I am looking at a design like this.

                          girishG 1 Reply Last reply
                          0
                          • mehdiM mehdi

                            @binary1zero From the constraints you mentioned, I do not understand why you don't simply use the home server as a main email server, but with an external relay for outgoing email (assuming your ISP does not block inbound 25).

                            From what I know, PTR and stuff is only necessary for outbound relay, as it mostly affects server reputation when other server decide incoming email is spam.

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

                            @mehdi said in Forward emails to remote SMTP server:

                            From what I know, PTR and stuff is only necessary for outbound relay

                            that's correct. PTR is for the server that does the mail transfer, so it won't be needed if an external relay is used. On Cloudron, the PTR check is skipped when using a relay.

                            1 Reply Last reply
                            0
                            • infogulchI infogulch

                              @mehdi iirc, one signal used to detect spam is whether the inbound and outbound IPs are the same. Maybe this is not the case, but Google and Microsoft are pretty finicky about email delivery so my instinct is to keep the externally visible configuration 'clean'. That's why I am looking at a design like this.

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

                              @infogulch inbound/outbound IP match is not needed. The reputation of outbound IP is very important though.

                              If @binary1zero is using some business IP from their ISP, one can just host the mail server from home/office instead of all this forwarding.

                              B 1 Reply Last reply
                              3
                              • girishG girish

                                @infogulch inbound/outbound IP match is not needed. The reputation of outbound IP is very important though.

                                If @binary1zero is using some business IP from their ISP, one can just host the mail server from home/office instead of all this forwarding.

                                B Offline
                                B Offline
                                binary1zero
                                wrote on last edited by
                                #16

                                @girish So I tried direct MX to my home and got errors:

                                [Default] 451-'4.7.1 Greylisting in action, please come back later' (delivery attempts: 5)>'
                                

                                So back to my original problem now - I'm thinking of either putting procmail on Synology and fetch emails or either use iptables/VPN route to send email home.

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

                                  I think you're looking for more of a mail relay setup with archival things done for incoming emails.

                                  Conscious tech

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