Difference between revisions of "Email Piping: Google Apps"

From WHMCS Documentation

m (Configuration)
m
Line 1: Line 1:
This article covers how to go about configuring your WHMCS installation's Support Ticketing feature along with Google Apps Hosted Email Service for Domains.
+
This article covers how to go about configuring the support ticket system to enable importing of new tickets and replies from e-mail accounts hosted with GSuite (formerly known as Google Apps).
  
It is assumed that you already have your WHMCS installation set up and working properly on your web server.
+
Before beginning, we recommend having WHMCS set up and working properly on your web server so as to avoid any unexpected issues.
If so then you are ready to go!
 
  
 
==Configuration==
 
==Configuration==
  
 
Follow these steps:
 
Follow these steps:
* Create a google app acct for your domain
+
* Create a GSuite account at https://gsuite.google.com/
* Verify your domain for Google
+
* Verify the domain where WHMCS is installed with GSuite and complete their setup process.
* Log into Google Control Panel for your domain and create appropriate email accounts that will be using WHMCS ticketing system and receiving tickets.
+
* Log into Admin Console at https://gsuite.google.com/ and create appropriate email accounts that will be using WHMCS ticketing system and receiving tickets and replies.
* For all accounts that will be receiving tickets, be sure to enable POP3 and IMAP in Google Mail's webmail interface. Please ensure that "Enable POP for mail that arrives from now on" is enabled as well, otherwise POP will be enabled for all e-mails in the inbox (even older e-mails that may not need to be imported) and will cause all of them to be imported by WHMCS.
+
* For all accounts that will be receiving tickets, be sure to enable POP3 and IMAP in Google Mail's webmail interface. * Please ensure that "Enable POP for mail that arrives from now on" is enabled as well, otherwise POP will be enabled for all e-mails in the inbox (even older e-mails that may not need to be imported) and will cause all of them to be imported by WHMCS.
* Adjust your mx records on your webserver to redirect your email service to google.
+
* Please ensure that Imap-SSL/Pop3-SSL in the PHP installation on the server. Such a change (if needed) will usually require the hosting provider or system adminstrator to do this. The reason for enabling this is because GSuite services will only accept secured connections. (or try install php5-imap package)
* Here's one of the "gotchas" in getting this set up.  You must enable Imap-SSL/Pop3-SSL with your webserver's php installation. Many times you will need to contact your hosting providers to do this for you. The reason for that is because Google Mail services will only accept secured connections. (or try install php5-imap package)
+
* Under Setup > Support > Support Departments in WHMCS, create at least one department and configure the email account assigned to it like so:
* In WHMCS, in support depts, Create a department and configure the email account assigned to it like so:
 
 
  '''hostname:''' pop.gmail.com
 
  '''hostname:''' pop.gmail.com
 
  '''port:''' 995
 
  '''port:''' 995
Line 19: Line 17:
 
  '''pwd:''' yourpassw0rd
 
  '''pwd:''' yourpassw0rd
  
 +
* Set up your cron job for the /crons/pop.php within your Web Hosting control panel (Plesk, cPanel, Direct Admin etc.) and set it to run every 5 minutes. An example of such a command is the following:
  
* In the account you set up in WHMCS in support dept, make sure to go into  google settings  to enable both IMAP and POP.
+
*/5 * * * * php -q /home/username/public_html/whmcs/crons/pop.php
* Set up your cron job within your Web Hosting control panel (Plesk, cPanel, Direct Admin etc.):
 
 
 
*/5 * * * * php -q /home/username/public_html/whmcs/crons/pop.php
 
  
 +
Once this is done, any new e-mails to the support e-mail addresses should be imported. If they are not, please follow the troubleshooting steps below to determine the cause and correct it as needed.
  
 
If you complete these steps then this should work wonderfully.
 
If you complete these steps then this should work wonderfully.

Revision as of 19:59, 29 December 2018

This article covers how to go about configuring the support ticket system to enable importing of new tickets and replies from e-mail accounts hosted with GSuite (formerly known as Google Apps).

Before beginning, we recommend having WHMCS set up and working properly on your web server so as to avoid any unexpected issues.

Configuration

Follow these steps:

  • Create a GSuite account at https://gsuite.google.com/
  • Verify the domain where WHMCS is installed with GSuite and complete their setup process.
  • Log into Admin Console at https://gsuite.google.com/ and create appropriate email accounts that will be using WHMCS ticketing system and receiving tickets and replies.
  • For all accounts that will be receiving tickets, be sure to enable POP3 and IMAP in Google Mail's webmail interface. * Please ensure that "Enable POP for mail that arrives from now on" is enabled as well, otherwise POP will be enabled for all e-mails in the inbox (even older e-mails that may not need to be imported) and will cause all of them to be imported by WHMCS.
  • Please ensure that Imap-SSL/Pop3-SSL in the PHP installation on the server. Such a change (if needed) will usually require the hosting provider or system adminstrator to do this. The reason for enabling this is because GSuite services will only accept secured connections. (or try install php5-imap package)
  • Under Setup > Support > Support Departments in WHMCS, create at least one department and configure the email account assigned to it like so:
hostname: pop.gmail.com
port: 995
user: youremail@yourdomain.com
pwd: yourpassw0rd
  • Set up your cron job for the /crons/pop.php within your Web Hosting control panel (Plesk, cPanel, Direct Admin etc.) and set it to run every 5 minutes. An example of such a command is the following:
  • /5 * * * * php -q /home/username/public_html/whmcs/crons/pop.php

Once this is done, any new e-mails to the support e-mail addresses should be imported. If they are not, please follow the troubleshooting steps below to determine the cause and correct it as needed.

If you complete these steps then this should work wonderfully.

Troubleshooting

There are a few troubleshooting steps one can take in troubleshooting this, if your set up isn't working properly.

  • Check your ticket import logs in your WHMCS installation: Utilities > Ticket Mail Import Log

What you are looking for here is to see if your Cron Job is attempting any import at all. If you don't see anything here then your cron job is not successfully attempting a ticket import.

  • Verify that, for your google email account you created, you have enabled both Pop3 and IMAP.
  • Verify that you cron job has been created and is running.
  • If the cron job is running, view the emails that your cron job is creating (you can configure your cron job to email its results to an email address) and see if an error is being generated.
  • If that command succeeds and no other firewall restrictions are in place, then your connection is unobstructed on your server side.

Connection refused

  • Check that your server's firewall isn't blocking traffic to google.
  • To make absolutely sure that your server's firewalls are not blocking your connection attempts, run this telnet command from your server: telnet gmail-pop.l.google.com 995

Too many login failures

  • Double-check the username and password entered on the Support Department configuration (Setup > Support > Support Departments > Edit) are correct.
  • Adjust your Gmail account settings to allow less secure apps. This allows external applications such as WHMCS to authenticate to your account via username and password.
  • Check the Recent Activity page in Gmail to see whether the login attempt was blocked at their end: ‘Suspicious sign in prevented’ email.

Can not authenticate to POP3 server

Refer to the troubleshooting steps for #Too many login failures

Password command failed

Refer to the troubleshooting steps for #Too many login failures


If you are still having issues after verifying the suggested troubleshooting steps above, then you will need to contact Google or visit their discussion forums for Google Apps. It is possible they may be blocking your server from accessing their mail servers.

Final thoughts

WHMCS and Google Apps do play well together and it does work, regardless of what version of Google Apps you are using: Standard, Premier or Education. If you get them working together, you'll be a happy camper. Just be diligent in your troubleshooting.

Workaround for those without SSL

Create another POP3 e-mail account at a different domain name outside Google Apps (that does not require SSL to pick up via POP3), and then have your Google Apps e-mail forward to that e-mail address. Then in WHMCS use POP3 to pickup your mail at the POP3 account that does not require SSL. The user will never notice since they send all e-mails to your Google Apps address, and receive e-mails "from" your Google Apps address (or whatever address you have assigned in WHMCS for that support department).