Import Emails with Webmail on a cPanel Server

When it comes to importing Emails on to a cPanel based server, using Webmail is the easiest method. Currently cPanel-based servers offer three different webmail interfaces [Horde, Squirrel Mail, and RoundCube] for viewing and managing email accounts without the need to setup an email client. This tutorial will focus on how to import emails from your server by utilizing the Horde Webmail interface.

While RoundCube does support email importing, it only allows you to do so with a single email at a time. This may not be an issue for some, but when working to import a large number of emails, this can be an inconvenience. Horde, on the other hand, allows the importing of entire folders, which can speed things up when working to import in bulk.

Pre-flight Checklist

  • These instructions are intended specifically for a managed Liquid Web server with cPanel.
  • The Horde Webmail interface must not be disabled on the server.
  • Access to the cPanel which owns the email address will be necessary.

Import Emails with Horde Webmail

For importing emails via Horde the process is largely the same as when exporting. You will need to start the same by opening the webmail interface for the email account. Once you are logged into the email address and have horde open you can proceed with the importing directions below.

Our example for importing continues from the examples set in exporting found above. Though, in this example we are using a different email account that is currently empty of any Emails.
    1. From the Horde interface of the account you wish to import to, right click the folder you would like emails imported to. We will use the Inbox.

Email Import - Horde Folder Menu

    1. From the folder drop down menu select “Import”

step-two

    1. You will now see a popup to select the file for uploading, select the file by clicking ‘Browse’ to use the file picker.

Email Import - Horde File Select

  1. With a file selected click the “OK” button and Horde will begin the upload and import. After clicking OK you should return to the main Horde interface, there you will begin to see the imported emails to populate.

With this step complete you can now see that the emails were imported. You can see this below by comparing the two screenshots:

Email Export - Horde Interface

Import Results

Export Emails with Webmail on a cPanel Server

When it comes to exporting Emails on a cPanel based server using Webmail is the easiest method. Currently, cPanel-based servers offer three different webmail interfaces [Horde, Squirrel Mail, and RoundCube] for viewing and managing email accounts. Using a webmail client allows you access to your Emails without the need to setup an email client. This tutorial will focus on how to export emails from your server by utilizing the Horde Webmail interface.

While RoundCube does support email exporting, it only allows you to do so with a single email at a time. This may not be an issue for some, but when working to export a large number of emails this can be an inconvenience. On the other hand, Horde allows the exporting of entire folders, this can speed things up when working to export in bulk.

Pre-flight Checklist

  • These instructions are intended specifically for a managed Liquid Web server with cPanel.
  • The Horde Webmail interface must be enabled on the server.
  • Access to the cPanel account which owns the email address will be necessary.

Export Emails with Horde Webmail

  1. Open webmail for the email address you would like to export.
    You can do this by either logging into webmail with the email address directly, or by going in through the cPanel account that owns the email address.

    Open Webmail via cPanel:

    1. Login to the cPanel account that owns the email address you are looking to export.
    2. On the main cPanel page for the account find and click the “Email Accounts” button.
      Email Export Main cPanel
    3. Now on the Email Accounts page, find the email address you’d like to export emails for. Click the “More” button and then find and click “Access Webmail”.
      cPanel Email - Action Menu

    Open Webmail directly:

    1. To open webmail directly you would pull up the webmail login by visiting:
      http://[Server IP]:2097 or http://[Server Hostname]:2097
    2. You should now see a Webmail login page where you can enter the email address and respective password to login.
  2. Once the Webmail login is complete, either by direct login or login via cPanel, you will be presented with a page for Webmail selection.

  3. You should select ‘Horde’ when presented the choice of a Webmail client application. Once Horde is fully loaded you will see an interface similar to the following screenshot:
    Email Export - Horde Interface

    You can choose any folder you would like, for this example we will be using the Inbox.
  4. From Horde, right click ‘Inbox’ and select ‘Export’ from the list.
    Email Export - Horde Folder Menu
  5. You will now see a popup with export options, you can simply click ‘OK’ to get the exported emails in MBOX format.
    Email Export - Horde Download

With that complete you should now see your browser downloading the Emails in the MBOX format. The MBOX file format is a fairly generic format used for backing up Emails. The MBOX format is essentially a plain text file and has a wide range of support with various Email clients.

For more details and information on this file format see the MBOX wikipedia page.

EasyApache 4 & CLI based PHP utilities

With the release of EasyApache 4 in WHM 58 there are various changes to how PHP is managed. The most obvious being that EasyApache 4 brings support for installing multiple PHP versions alongside each other. However with multiple versions of PHP being installed on the server it’s easy to lose track of your command-line based PHP utilities and their PHP requirements.

Certain PHP packages like Composer, Drush, and WP-cli prefer to be run with the latest version of PHP. Unfortunately, having multiple PHP versions can mean not knowing which PHP will execute the utility when you call it directly. This article will detail a few methods to specify which PHP version should be used in instances like this.

Pre-flight Check:

  • These instructions are intended specifically for cPanel-based servers running WHM prior to version 58.
  • Command line access via SSH may be necessary to follow the examples.
  • The server will need to have EasyApache 4 active.
  • PHP 7 will be necessary to follow the provided examples.

Option #1: Directly Call the PHP Binary

The most basic option to workaround these issues is to directly call the PHP binary you need before executing the script. While this can be effective and will work as expected most of the time, certain utilities will not work when using this method.

You may want to attempt this method first and move on to Option #2 if this does not work as expected; generally though, this should work for executing basic PHP code.

/opt/cpanel/ea-php70/root/usr/bin/php someScript.php

The above command will specifically call the 7.0 version of PHP and will execute the someScript.php file within that version of PHP. If they are also installed on the server, the alternative PHP versions can be found at:

  • /opt/cpanel/ea-php55/root/usr/bin/php
  • /opt/cpanel/ea-php56/root/usr/bin/php
  • /opt/cpanel/ea-php70/root/usr/bin/php

Option #2: Use scl to Specify PHP Versions

As mentioned, certain PHP utilities are not provided as basic PHP files and are stored in the PHAR format. These utilities will not execute properly with the above method for specifying the PHP version. For these types of utilities you will need to specify the PHP version using a command called `scl`.

This command is a utility that allows running software in an environment packaged as a ‘Software Collection’. To be brief a ‘Software Collection’ is a way of defining an alternate location to a certain software. Fortunately, WHM provides predefined collections for the various versions of PHP supported by EasyApache 4.

The syntax of this command is as follows:

scl enable {SoftwareCollection} '{CommandToRun}'

Where you replace {SoftwareCollection} with the needed collection [ea-php55, ea-php56, or ea-php70], and you replace {CommandToRun} with the command, utility, or script you need to run.

A good way to highlight this is to review the difference in the following outputs:

root@noms [~]# php -v

PHP 5.6.25 (cli) (built: Aug 25 2016 17:00:38)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies

root@noms [~]# scl enable ea-php70 'php -v'

PHP 7.0.10 (cli) (built: Aug 25 2016 18:04:55) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.10, Copyright (c) 1999-2016, by Zend Technologies

As you can see when calling PHP by itself we get the default version, but when using scl we explicitly called the PHP 7.0 collection and get results to match.

Example #1: Executing a utility [Composer]:

root@noms [~]# scl enable ea-php70 'composer --version'

Composer version 1.2.0 2016-07-19 01:28:52

Example #2: Running a PHP script:

root@noms [~]# scl enable ea-php70 './someScript.php'

With these key tips and tricks you should now be equipped with the necessary tools to run CLI utilities on a server using EasyApache 4. If you have any questions or are not comfortable making these changes yourself, please feel free to contact Heroic Support®.

Enable Remote MySQL Connections in cPanel

Remote MySQL connections are disabled by default in cPanel servers because they are considered a potential security threat. Using the tools in the Web Host Manager (WHM) and the domain-level cPanel interface (usually http://domainname.com/cpanel) remote hosts can be added which the server allows to connect to the MySQL service.

Before using either of the following techniques, you will need to to open up port 3306 in your server’s firewall.

Enabling Remote MySQL in the WHM Interface

Log in to the server’s WHM interface and find the section in the left-side navigation bar labeled SQL Services. You can sort the list by typing ‘sql’ in the search box. Click on the link marked Additional MySQL Access Hosts:

WHM - Remote MySQL List

On the following page, enter one or more hosts or IP addresses in the text box (1) and click the Save button (2). If you wish to activate these settings on all user accounts see (3).

WHM - Remote MySQL page

Now that the remote connection has been activated in the WHM each domain account that wants to use the remote connection will need to activate it in their own cPanel interface.

Enabling Remote MySQL in the Domain cPanel Interface

Log in to the domain’s cPanel interface and find the section on the main page labeled Databases.

In the Databases section find the link/button labeled Remote MySQL and click on it.

cPanel - Remote MySQL list

The following page will appear in your browser. Add a hostname or IP address that you want to grant remote MySQL access to (1) and then click the Save button (2).

If a host or IP address needs to be removed from this list you can click the ‘Delete’ button next to the entry in the list.

cPanel-page-fxt

Once you have made your changes, additions, or removals to the list you can return the main page of the cPanel interface, or log out if you have no other tasks to take care of.

===

Liquid Web’s Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Toll Free 1.800.580.4985
International 517.322.0434
support@liquidweb.com
https://manage.liquidweb.com/

What’s New in WHM 58 & What to Look For

In the 58 update of WHM & cPanel several rather large changes have been made to improve upon user experience and to expand available features. As cPanel works to continually expand and improve their offerings, we like to do our best to keep everyone informed and updated. Here are some of the highlights and items to look out for as the 58 update moves to release tier.

What to prepare for?

When large WHM updates, similar to this one, are released, there are often certain items that may exclude a server from being eligible for the update. These are often referred to as ‘update blockers’ within the official documentation. The items here are changes related to these ‘update blockers’.

  • CentOS 5 & CloudLinux 5 are no longer supported by WHM on and after update 58
    • CentOS 5 itself, and therefore CloudLinux 5, are becoming end-of-life status on March 31 of 2017, due to this and software limitations that these OS’s cause, cPanel is removing support preemptively.
  • Servers’ processors must now support 64-bit processing
    • Any older servers with 32-bit (x86) processes will no longer be supported by cPanel/WHM.
  • For a more detailed list of Upgrade Blockers please see: https://confluence2.cpanel.net/display/ALD/58+Release+Notes
  • These update blockers will require a migration in order to update to WHM 58: Feel free to contact our Heroic Support® if you are experiencing these blocks.

What is new?!

On this release cPanel has included a lot of highly-requested features and improvements. This provides for a lot of new opportunities, but with so many changes, it’s easy to lose track of all the great new features that were added. Here are the highlights:

  • Addon Domain to account conversion tool
    • With this new feature you are now able to easily convert an Addon domain into a full-fledged cPanel account.
  • Roundcube is now provided via RPM’s
  • Support for Dovecot’s mdbox storage format
    • Previously email files were stored on a ‘flat file’ manner, one file for each email. Now a user’s complete email storage can use the mdbox file format.
    • For users with large numbers of emails this should help reduce issues and concerns about using up too many disk Inodes.
  • Dovecot now supports email subaddresses
    • Email users can now append their address in a manner that will automatically deliver a message to a specific folder.
    • E.G.: username+Important@email.com will deliver a message directly to the ‘Important’ folder for the username@email.com address.
  • EasyApache 4 has been released
    • It is the default on new WHM installations
      • Existing servers will need to upgrade manually, once upgraded this cannot be reverted.
    • Now fully supports PEAR and PECL
    • EasyApache config tools have been completed as well
      • Provides useful tools to manage EasyApache 4 profiles
    • PHP-FPM support is now included, although it’s not fully refined yet and must be activated outside of WHM.
      • Contact Heroic Support for assistance on setting up and deploying PHP-FPM.
  • Multi-PHP Manager released
    • With EasyApache 4 being released the new Multi-PHP manager has been completed as well.
    • Servers can now operate while providing multiple PHP versions with ease.
  • PHP 7 is now supported and provided via EasyApache 4
  • AutoSSL
    • Free domain-validated SSL certificates are provided by cPanel (powered by Comodo)
    • As of WHM version 58.0.17, and above, AutoSSL now supports Let’s Encrypt as an SSL provider; for more details, see our KB article here.
Free cPanel-provided hostname SSL’s have been provided since WHM release 56 as well.
  • WHM now provides Composer by default
    • Composer is a dependency management tool for PHP-based projects, used frequently in the development and deployment of PHP-based apps, sites, or projects.
    • The WHM provided version does support Composer’s internal update mechanism to stay updated.

What has been changed?

Based on user feedback cPanel will make changes to presets, or default settings, as well as providing updates for 3rd-party tools included in WHM. This section encompases these types of updates.

  • Munin has been updated to provide the 2.0 version
    • Munin is a free system, network, and infrastructure monitoring tool.
  • Reject SPF failures is now enabled by default.
    • This will ensure that servers are checking incoming mail for valid SPF records and will reject Emails which result in a failure.
    • Provides an easier setup for WHM and helps prevent spam.
  • Prevent ‘nobody’ from sending Email now enabled by default.
    • Apache traditionally runs as the ‘nobody’ user and this change to the settings will ensure that by default servers are secure from Apache sending mail.
    • Helps to prevent compromised or unsecure sites for sending outgoing spam.
  • Dovecot now functioning as the local mail delivery agent
    • Exim will now receive inbound messages, connect to Dovecot via LMTP (Local Mail Transfer Protocol) and then deliver the messages.
  • WHM’s internal version of PHP has been updated

What has been removed?

cPanel will often remove redundant, legacy, or unneeded items or features; some of those to keep an eye out for are:

  • Removed ‘Mailserver Selection’ page from WHM
    • In previous releases WHM removed support for Courier and as such this screen is now unused.
  • Bandmin has been removed
    • Bandwidth usages can still be seen and monitored in:
      • Home >> Account Information >> View Bandwidth Usage, or
      • Home >> Metrics >> Bandwidth
  • Stunnel support has been removed
  • Security Advisor has been removed – check on new vs. existing

For more information and details on the various changes coming in the 58 release of WHM and cPanel, please see the official release notes here: https://confluence2.cpanel.net/display/ALD/58+Release+Notes

If you have any questions or are not comfortable making these changes yourself, please feel free to contact Heroic Support®.

How to Access cPanel File Manager

 
This tutorial assumes you’ve already logged in to cPanel.

  1. Scroll down a little to find the File Manager link. Now click on File Manager.

    filemgr-cpanel-1-access-scene3_1

    Notice that File Manager has been opened in a new tab of your browser.
    You’re now in the File Manager area.

  2. To log out of the File Manager, just close the tab.

    filemgr-cpanel-1-access-scene4_1

    Now you can log out of cPanel. Click the log out button at the top of the screen.

    filemgr-cpanel-1-access-scene6_1

  3. Click on Logout to log out of cPanel.

 

Understanding Menu Items in File Manager

 
This tutorial assumes you’ve already logged in to cPanel’s File Manager.
The cPanel File Manager has powerful features to manage your files. Let’s check all of the features you can use in this web-based file manager.

  1. You can create new files and new folders with these menu items.

    filemgr-cpanel-2-menuitems-scene2a

    You can copy files and folders into  the same or other folders. You can also move them easily.

    filemgr-cpanel-2-menuitems-scene2b

  2. To delete files, simply click on Delete.

    filemgr-cpanel-2-menuitems-scene2c

    An FTP client is no longer needed to upload and download files and folders. You can simply do it via these buttons!

    filemgr-cpanel-2-menuitems-scene2d

    You can even edit text based files like HTML, PHP and text files with the help of these menu items! No need to use web page editors for small changes.

    filemgr-cpanel-2-menuitems-scene2e

  3. Some web based script installations will require you to change file and folder permissions, which you can do with this button.

    filemgr-cpanel-2-menuitems-scene3a

  4. View files by clicking this button.

    filemgr-cpanel-2-menuitems-scene3b

  5. Have too many files to upload? Just compress it and upload it in a ZIP file and extract it with this button.

    filemgr-cpanel-2-menuitems-scene3c

  6. Too many files to download? Just compress it with this button.

    filemgr-cpanel-2-menuitems-scene3d

  7. This area shows the file and folder structure of your website.

    filemgr-cpanel-2-menuitems-scene4a

  8. This area shows the contents of the selected file or folder (in this case, the public_html folder).

    filemgr-cpanel-2-menuitems-scene4b

  9. These navigation buttons let you go to other folders, reload file lists and select or deselect files and folders.

    filemgr-cpanel-2-menuitems-scene4d

  10. You can also search files here.

    filemgr-cpanel-2-menuitems-scene6_1

    We will learn all these navigation items in detail in the next tutorials.

 

Understanding File Structure in File Manager

 
This tutorial assumes you’ve already logged in to cPanel’s File Manager.

  1. All of your website’s files should be in the public_html folder. When you are in File Manager, always select it first to access your files.

    filemgr-cpanel-3-structure-scene02_1

  2. You can find which folder you are accessing now by checking the path here.

    filemgr-cpanel-3-structure-Scene3b

    The public_ftp folder has all your public ftp account data.

  3. Click on public_ftp to continue.

    filemgr-cpanel-3-structure-scene05_1

    Unless you are an advanced user, we strongly advise you not to touch or modify the contents of this folder.

    filemgr-cpanel-3-structure-Scene5b

    You are now in your public_ftp folder. You can see all the data uploaded by anonymous FTP users.

  4. Let’s check the Mail folder. Click on Mail.

    filemgr-cpanel-3-structure-Scene5c

    You are now in the mail folder. Here you’ll see the same folders as you see in your mail client. All of your email data will be stored in these folders.
    Unless you are an advanced user, we recommend that you do not modify the contents of this folder either.
    Now let’s have a glance at the other folders.
    This folder contains the cPanel software data.

    filemgr-cpanel-3-structure-Scene7a

    This folder contains encrypted passwords.

    filemgr-cpanel-3-structure-Scene7b

    As the folder name suggests, this folder is .trash, all deleted files and folders are moved here.

    filemgr-cpanel-3-structure-Scene7c

    This folder contains access logs for your website.

    filemgr-cpanel-3-structure-Scene7d

  5. You can access any of the folders or sub folders directly by typing the path here.

    filemgr-cpanel-3-structure-Scene8a

    Type your desired path and click the Go button.

    filemgr-cpanel-3-structure-Scene8b

    You are now in your desired folder.

 

How To Create New Files and Folders in File Manager

 
This tutorial assumes you’ve already logged in to cPanel’s File Manager.

  1. Click on New File.

    filemgr-cpanel-4-new-scene02_1

    Leave the public_html path as it is because we always need to upload files in this folder. You will learn how to upload files in subfolders a little later.

  2. Type the file name here.

    filemgr-cpanel-4-new-scene03_1

  3. Then click Create New File.

    filemgr-cpanel-4-new-scene04_1

    Your file has been created successfully.

  4. Let’s create a new folder now. Click on New Folder.

    filemgr-cpanel-4-new-scene05_1

  5. Type the folder name here.

    filemgr-cpanel-4-new-scene06_1

  6. Please type the path where you want to create this new folder.In this case, we will keep it as it is.

    filemgr-cpanel-4-new-Scene6a

  7. Click Create New Folder to continue.

    filemgr-cpanel-4-new-Scene6b

    Your folder was created successfully.

    filemgr-cpanel-4-new-Scene7a

    You can also see it in the left margin.

    filemgr-cpanel-4-new-Scene7b

 

How To Copy and Move Files in File Manager

 
This tutorial assumes you’ve already logged in to cPanel’s File Manager.

  1. Select the file you want to copy. Let’s select testfile.html.

    filemgr-cpanel-5-copy-scene02_1

  2. Click on Copy.

    filemgr-cpanel-5-copy-scene03_1

  3. Please type the file destination, in this case, we will use the “test” folder, then click on Copy File(s).

    filemgr-cpanel-5-copy-scene04_1

    You have successfully copied the file. To check it, either double click on the “folder name” in the right margin, or single click on the “folder name” in the left margin.

    filemgr-cpanel-5-copy-scene05_1

    It’s there. You have successfully copied the file.

  4. Now let’s Move newtest.html to thepublic_html folder. Select newtest.html, and click Move file.

    filemgr-cpanel-5-copy-scene07_1

  5. Make sure your path is public_html only. Now click on Move file(s).

    filemgr-cpanel-5-copy-scene08_1

  6. Notice that the newtest.html file is gone from this list. To confirm that it has moved to public_html, click it in the left margin.

    filemgr-cpanel-5-copy-scene10_1

    Congratulations, you have successfully moved the file. You can also copy multiple files by simply pressing the control key, selecting them and dragging the files to the destination folder in the right margin. Or you can move a single file by just dragging it to the destination folder in the left margin.