Email Importing

From WHMCS Documentation

Email importing is distinct from email piping and requires a different configuration. We recommend using email importing instead of email piping if you use any control panel other than cPanel or if you want to import email from multiple domains.

RFC 3834
In WHMCS 8.1 and later, the system sends support emails with RFC 3834-compliant headers by default.

  • You can disable this at Configuration () > System Settings > General Settings in the Mail tab.
  • Regardless of your settings, WHMCS will not accept email that contains the Auto-Submitted header via email piping or email importing.

Email Importing with OAuth

WHMCS 8.1 and higher introduces support for email importing using OAuth with Gmail. OAuth provides access to your mail provider, and is more secure than traditional username-and-password authentication. Some mail providers are requiring OAuth, or have announced a requirement for it in the future.

To use OAuth for Gmail with WHMCS, you will need to both configure Gmail as your mail service provider and create an app for it in the Google Cloud console. For more information, see Setting Up POP3 Importing with OAuth via Google.

Configuring Email Importing

The cron command

To configure email importing for a support department:

  1. Set up your email accounts:
    • For email importing with OAuth, configure Gmail as your mail service provider and create an app for it in the Google Cloud console. For help with this step, see our Setting Up Email Importing with OAuth via Google documentation.
    • For non-OAuth email importing, create a unique email account on your mail server for each support department. This must be a full inbox; an alias is not sufficient.
  2. In WHMCS, navigate to Configuration () > System Settings > Support Departments.
  3. Create a new department and enter the top section of information or, for existing departments, click Edit.
  4. Enter the email information for the department.
    1. Select a Service Provider. If you want to use OAuth via Gmail, select Google. Otherwise, select POP3/IMAP.
    2. Enter a Hostname, or, if you selected Google, make sure that pop.gmail.com is already set.
    3. Enter a Mail Server Port. Usually, this is 995.
    4. Select your Authentication type. If you want to use OAuth via Gmail, select OAuth2. Otherwise, select Password.
    5. Fill out the remainder of the form:
      • If you selected Password as your Authentication type, enter the email address and password for the email account that you created.
      • If you selected OAuth2 as your Authentication type, enter your Email Address and the ClientID and Client Secret that you generated through Google. Then, click Connect.
  5. Set up a cron job to run the pop.php file using the Ticket Importing using Mail Importing (POP3/IMAP) command on the Support Departments page every few minutes. We recommend that you set this to run every five minutes.

Deleted Email
The system will delete email in the source mailboxes upon successful import into WHMCS.