Forward emails to remote SMTP server
-
@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.
-
@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.
-
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.
-
Previous discussion on the topic:
-
@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
-
@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.
-
@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.
-
@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.
-
@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.
-
@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.