Question

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

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

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.