Report this

What is the reason for this report?

How to set up a Mail Server that uses GMail as the backend, on Ubuntu/Apache with Multiple Domains on Virtual Hosts

Posted on July 18, 2015

I have multiple domains set up on multiple virtual hosts (Ubuntu 14 with Apache).

I want to create a simple email send and receive system that uses GMail accounts as POP3 mailboxes.

I don’t need WebMail, or Spam filtering or Virus filtering, etc., because GMail will do that. I don’t need IMAP.

Each domain needs a single email address, no more.

What’s is a simple recipe to achieve this? (Note that I have virtual hosts, and I would like each domain to get its own email address using that domain).

Step by step instructions will be most helpful!

keywords: postfix dovecot iredmail qmail mx record cname



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

We have this setup working well with Ubuntu 16.04, with multiple domains / Gmail boxes, spam/antivirus filtering, dmarc setting (for our domains) and dmarc checking/blocking (for other domains). Also when an email is returned by Gmail as being unsuitable it isn’t sent again (even though Gmail may have given a transient error code) and the sender’s ip is banned for a period.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.