I'm trying to figure out if there is a way that an email can be sent to two mail servers. One being a local server configured in CPanel and the other is Google Apps.

I've already configured the server to allow for email to be sent to Gmail's servers with the MX record. But now I want it to also keep a copy of the email on the actual Cpanel server. That way any mail that is sent to an email address is viewed in Google Apps AND left on the server for Cpanel Horde/etc to receive.

I'm attempting this because of the fact that my webhost doesn't allow connections for some reason to Google Apps via a PHP script (like setting it up would cause errors).

Can anyone help?

  • To help address the issue, can you say why do you need two copies of every message?
    – danlefree
    Dec 27, 2011 at 0:07
  • Certainly. I was planning on using the program OSTicket to handle Support Tickets for my site. However, after some fiddling, I found that I can pipe mail through the program and have it import that way, thus making accounts not needed. Now comes the new problem. If I set up the pipes, I can't use Google Mail for other accounts. If I use Google Mail, I can't use the pipes. Dec 27, 2011 at 3:37
  • Updated accepted answer (sorry, overlooked potential for OSTicket outgoing messages to be picked up as spam if not from smtp.google.com)
    – danlefree
    Dec 28, 2011 at 2:32
  • Your modified answer regarding the sub-domains is still valid. I did several test runs of it today and didn't have any problems using Google Apps mail to forward the message down for importing to the subdomains. Even still works that I send the messages FROM the non-subdomain address and they're accepted into OSTicket. Dec 30, 2011 at 1:35

1 Answer 1


Google Apps includes a variety of ways to divert mail to multiple inboxes, however, there is not (to the best of my knowledge) any reliable way to send and receive e-mail through Google Apps while sending and receiving e-mail through a cPanel server under the same domain. The following solution allows you to make full use of Google Apps' excellent spam filtering and overall uptime while maintaining an accountability trail for incoming messages intended for OSTicket.

  1. Use Google Apps to host mail under your primary domain; use cPanel to host mail under a subdomain (i.e. support.domain.com) and create an e-mail user [email protected] on that subdomain

  2. Create a Google Apps user account for the alias you will use ([email protected]) to forward mail Create a Google Apps user account ([email protected]) to act as a catch-all for your domain - the advantage of using [email protected] over [email protected] will become apparent when you find a need to add other aliases

  3. In the account, create a filter to forward (and mark as read) messages addressed To: [email protected] to the [email protected] address

  4. Configure your application (i.e. OSTicket) to route outgoing mail with the Google Apps SMTP settings to send messages as [email protected]

  • I like this and I pretty much figured out how I'm gonna use it with the multiple emails thanks. Dec 28, 2011 at 4:52
  • Ahh I see what you just did as I refreshed the page Dan, problem is the webhost I'm at won't let me use GMail to send the mail AS Gmail. (It won't let me connect via SSL for some reason which is what you need to connect to Gmail with). Dec 28, 2011 at 4:54
  • There remains the option of using the [email protected] subdomain address directly (no saved copies at Google but would solve messages being flagged as spam), however, unless you're locked in to your hosting provider, it may be more economical to find a host that supports outgoing SMTP over SSL - many of the larger cPanel hosting providers could accommodate this configuration.
    – danlefree
    Dec 28, 2011 at 6:06
  • I'm semi-somehwat locked into my host for the most part. I'm open for possibly moving if it fits. Already fell into one trap of a host that weird restrictions on MySQL operations. It wasn't pretty. Dec 28, 2011 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.