• Skip to main content
  • Skip to primary sidebar

Founder at work

Master the skills to create and launch your next SaaS company

  • About Me
  • Reviews
  • Resources
  • Community
  • Contact
  • Lessons
  • Series
  • Search
  • Login

How to redirect your domain emails to gmail for FREE (Digital Ocean, PostFix, DNS Setup)

June 7, 2015 by Rick Hernandez Leave a Comment

Creating a digital empire is not easy, let’s say that their is 40 domain names that are under the umbrella of your consulting firm. No problem right? just jump unto google business and pay the $5 dollars per domain. Although this solution works, and it’s the most reliable option that I have found for the price.

Take for example that you own foo.com and bar.com. Some of this domains might have the following emails.

[email protected]
[email protected]
[email protected]
[email protected]

With google business you can easily just pay $10 USD a month and move on since this covers alias for each of the domains, meaning you can have infinitely many emails for those domains (foo.com, bar.com), but this bill just start’s going up the more domains that you add to it.
T\quad =\quad D(5)
For the 40 domains, total’s up to $200USD a month which turns into $2,400 per year. It’s just the cost of doing business right? Well what exactly is google doing for those $5 anyways. For my use case, I’m just forwarding the email’s to my current Gmail account.

Finding other services that are cheaper do exist, but they don’t even come close to what google offers. After learning how email actually works I decided to setup a MTA(mail transfer agent) on a ubuntu machine using Postfix.

Looking at the documentation of Post Fix, I have to admit they are a bit cryptic, this guide is to ease some of this pain.

Start by creating an account with Digital Ocean, and setup a ubuntu VM.

Digital Ocean

Setup Godaddy with Digital Ocean

Now tell your domain provider(GoDaddy) about the new DNS that Digital Ocean provides.

NS1.DIGITALOCEAN.COM
NS2.DIGITALOCEAN.COM
NS3.DIGITALOCEAN.COM

With godaddy this would look something like this.
godaddy setup

Setup MX and A records in Digital Ocean

Next we have to setup a new A record and MX record.
A record

Name: domain.com
Address: 133.22.222.110

MX record

HostName: domain.com
Priority: 5

Now that this is out of the way lets go and wait patiently for 48 hours to let this propagate.

Configuring Postfix

SSH into your existing server, and now just install postfix.

Before setting up postfix let’s touch two files that will be needed for the setup.

Add mail.domain.com to this file

Now let’s make some changes to the config file. /etc/postfix/main.cf

From the config above make sure that the following lines have the domain name that you intend to use.

Now add the emails alias that you want PostFix to forward to.

Setup the emails that you would like to forward.

Now let’s make sure that the PostFix is aware of this new mappings

Wrap this up

Last part remaining is to send a test email, send-mail.org, is a nice tool that is free which does exactly that. Now verify that you received the email.

Postfix is a great way to forward emails and gives you more granular control over your emails. Now that I have just saved you $2280(possibly even more in some cases), go out and travel somewhere amazing.

Don’t forget about your $10 dollars.

Digital Ocean

HELP!

Depending on the type of problem that you might be dealing with here are some handy commands to know, and the location of important logs.

Rick Hernandez

I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: Business, Human Interaction, Linux, Linux networking, Networking, PostFix

Primary Sidebar

Learn How To Take Your Idea And Convert It Into An App From Scratch Even If You Have Never Written A Single Line Of Code.

  • How to Find Your Next Great App Idea
  • The Secret To Getting PAID To Build Your Own App
  • How To Create Your App (SaaS, Mobile, VR, AR, Game)
  • How To Monetize Your Apps
Learn More
4.82 Ratings

Copyright © 2025 · JSecademy Blog Theme on Genesis Framework · WordPress · Log in