How to run an express App in Digitial ocean/AWS/GCP and use mailservice from cpanel(webmail)

戏子无情 提交于 2019-12-13 03:05:22

问题


My scenario is am running my server in cloud platform which doesn't have cpanel, what I have is another normal shared hosting service with cpanel support . is there any way to run the site in cloud and use the webmail service provided by shared hosting provider for my domain name? if there is anyway can anyone please explain how to do this as I don't want to shell out money to setup gsuite kind of service. Thanks in advance


回答1:


finally, I figured it out on my own with some research in google.

  • 1) Add new A record ( if possible/allowed add with name @ ) in your shared/hosting/cpanel service, and point it to your cloud providers IP(the IP on which your app is running).
  • 2) Add another A record with name www and point it to the IP of your service running in the cloud.
  • 3) Delete the CNAME record called mail.
  • 4)Add new A record with name mail and point it to your cpanel / webmail service providers IP.
  • 5)Add MX record and point it to destination mail.yoursitename.tld and set the priority as 0

By this point, you will be able to send mail.

  • 6) Add SPF record ( TXT record ) or go to Authentication settings in the Email section in your cpanel and enable SPF.

  • 7)Go to Email Routing in the Email section in your cpanel and select your domain then choose Local Mail Exchanger under Configure Email Routing. That's it now you will be able to receive emails also.

These were the steps I followed to make it work, my app is hosted in GCP and I am using the mail service provided by cpanel-webmail(Hostgator).

This link helped me a lot to figure out the initial steps ,( Answer by the user jtittle1 ) https://www.digitalocean.com/community/questions/how-to-solve-emails-problems-after-site-is-migrated-to-digital-ocean



来源:https://stackoverflow.com/questions/55546811/how-to-run-an-express-app-in-digitial-ocean-aws-gcp-and-use-mailservice-from-cpa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!