moving from local mail to google apps


Currently, I’ve got Mail for Domain Enabled and have been receiving mail with no trouble.

We are interested in offloading our mailbox handling to google apps and want to ensure that mail for our domain gets sent to gmail.

Is this as simple as unchecking the Mail for domain enabled? checkbox?

Also, we have postfix installed as the mail server, it will continue send mail out as it always has regardless of the status of this checkbox, correct?



Yup, you’d just need to uncheck “mail for domain”, and also setup DNS for your domain to point to the new MX server over at GMail.

Mail would indeed go out as normal from your box. One thing to remember is to be careful about SPF records – SPF specifies what IP addresses may send mail for your domain. If you’ve setup SPF, you’ll either want to disable it, or have it include GMail’s mail servers.

I would be interested in knowing the why of this choice. What advantages do you see in offloading your incoming mail to Google?

Thought of any disadvantages?

Just curious, may help others thinking about doing the same thing,


You don’t have to run clamav and SpamAssassin on your server. These are pretty much universally the biggest things running on any Virtualmin system. ClamAV is about 75MB (more on a 64 bit system), and SpamAssassin is another 40MB (much more on a 64 bit system). lookup-domain-daemon (the Virtualmin daemon that handles spawning the mail processing tools and keeps up with user preferences and auto-responders and other stuff) is another 38MB. So, just filtering spam and viruses is costing well over 100MB. Some of that is shared resources, because lookup-domain-daemon and spamd are both Perl processes and can share the Perl libs. But, nonetheless, processing spam and viruses is very resource intensive.

Google is pretty good at spam and virus filtering. In my experience, about as good as an up to date spamassassin and clamav installation, performing correctly. I have a mailbox from an old company running at GMail and it gets about the same volume of mail as my current Virtualmin address (which is running Postfix/SpamAssassin/ClamAV and as of last week postgrey), and they both get about the same level of spam sneaking past the filters: three or four per day out of several hundred messages.

The next version of Virtualmin adds support for postgrey, which is cool and will reduce the CPU used for later stage spam filtering by a measurable amount (policy stage decisions are cheap, later stage decisions are more expensive). But, it also has a cost. Looks like about 16 more MB if I’m reading it right (also Perl, though, so it’ll be sharing with spamd and lookup-domain).

You don’t have to store mail. This may or may not be an issue. My Maildir, including all folders, currently has about 150,000 messages, and is probably several tens of GB in size. Obviously, text email is pretty small. But, searching my mail with Dovecot can be less than ideal…Gmail definitely gets searching mail right. It’s wicked fast, no matter how many messages you have.


You have no control over it, and you don’t have access to the raw data.

If you have interesting uses for your mail, like mailing lists with Mailman, notifications for software like CMS or forums or ticket trackers or wikis, etc. you can’t really do them effectively via GMail. Both their terms of service, and their protocol access makes it pretty difficult to do.

You generally have to use their tools. It’s possible to export and it’s also possible to retrieve via POP or IMAP, but if you happened to want to do anything on a regular basis with your mail, it’s nicer to have a local Maildir to work on.

You probably have to pay for it. Apps for your domain costs, I think, $50/year. Maybe more for many users, I’m not sure. I have it for my old domain, as I wanted to try it out, and I wanted a really nicely searchable mailbox for that account, because I only login once every month or two, and sometimes need to find the important stuff via search. This is probably more expensive than hosting it yourself. Maybe a lot more, if you have a lot of mailboxes.

On the whole I can’t really say I blame folks for using GMail. GMail is a really solid product that works as advertised.

as Joe mentioned, moving the mail handling of this particular box appealed to us for a variety of reasons. less overhead on the server, google offers a free version, closing down ports, etc.

We don’t have a need for anything too sophisticated with this domain, so it works for us.



meant to say off this box…the edit feature didn’t work…

Yeah, there’s a lot of features that don’t work… that’ll be corrected when Joe gets us moved over to the new website! Hopefully soon :slight_smile:

Postgrey will be nice! Can’t wait for that.

Was not trying to say it was a bad idea to move to gmail, was just asking the reasons. I knew what most possible reasons were, but, sometimes, it’s nice to hear some new ones.

Yes, searching tons of email via Dovecot is less than ideal, but, with an email client, it’s all local depending on how you set up your client. That’s the “better” way. Or at least more efficient. 150,000 messages? I guess you never delete any then! I have received more messages than that, but, cleanup the mail box by policy.

Presumably, you could also say you have no need for a backup mx then, relying on Google to take care of that.

It’s not for me though. Still, it was good to read the logic. And I can see how it would make sense for some folks.


After a week of running both mail servers (local and google) I decided to go ahead and shutdown the local service by unchecking the box, as suggested.

However, even with this unchecked, mail that is generated on the box still gets delivered locally rather than sent to google’s mail servers. Mail that is generated of my server is being sent to google, so I’m certain the DNS is setup correctly.

Do I need to disable/delete the mailboxes before unchecking the box?

Please advise.



Mail that is generated OFF my server…not of…

Yeah, I dunno what actually is disabled when disabling the local mail service, and how that affects existing accounts.

So what do you want delivered remotely – everything, including email for root and such?

A faster way than deleting all the accounts might be to comment out the "virtual_alias_maps" line in your /etc/postfix/ file.

You’ll also want to make sure “mydestination” isn’t set to an address that should be delivered over at Google apps.

Also, be sure that “root” and such are being correctly forwarded to an external address, you may need to setup an alias in the aliases file if it isn’t already.

I apologize, I don’t need all mail sent to google, just mail for the domain that I’ve moved to google.

After unchecking the Mail for domain enabled? box, i tested it and mail was still delivered for that domain. Is there something additional that I should do?



I apologize, I don't need all mail sent to google, just mail for the domain that I've moved to google.

It’s probably not your fault, I didn’t read the entire thread before replying :slight_smile:

I’m guessing what is happening is that unchecking that box removes the option for adding additional email accounts, but isn’t actually disabling the current ones in Postfix.

You may want to disable/delete the email accounts and aliases that are already on there for that server.

In order to get postfix to stop trying to deliver locally, I had to:

  • open /etc/postfix/virtual and comment out all the users

  • then while in the /etc/postfix dir, run postmap virtual

  • then in update mydestination and comment my domain

Finally got it…

Sorry for waking up old thread but i can’t make google apps receive my mails.

I am webmin noob. I just want don’t send mail for specific domain localy. Can someone tell me what exactly i should do?

I turned off “Mail for domain”. I tried change postfix but i don’t understand what i should edit. I also tried follow joek168 advice but i am not sure about commenting “all the users”. Inside i have something different, because there is no my domain or any domain. Also what should be in mydestination?