Back to main F.A.Q. page
WebMail Pro page

AfterLogic WebMail Pro PHP

 

1.  How to start? Where is Setup.exe?

AfterLogic WebMail Pro PHP is a PHP web application which is often installed on shared hosting which does not allow you to run .exe files. Thus, it's required to manually upload the application files to the server and set the appropriate permissions for files and folders. See "Installation instructions" for details.
 

2.1.  I'm getting 'WebMail is not configured properly' error. What's wrong? (Linux only)

This error usually occurs due to the following reasons:
  • The path to WebMail Pro data folder has not been specified. See below how to specify it.
  • The specified data folder location could not be accessed by WebMail Pro application (typically, insufficient permissions for apache.apache user to access data folder). Read More
WebMail Pro installation consists of two main folders: web and data. The web folder contains the WebMail Pro application itself. The data folder stores settings, temporary files, etc. You will usually place web and data folders into different locations on the server because web folder must be visible to everyone (i.e. you can access it from the web via HTTP or HTTPS) whereas data folder must be not (i.e. only WebMail Pro scripts should have access to this folder as it contains private data of your mail users).

To let WebMail Pro application know where you placed data folder, you should specify the path to data folder in $dataPath value of inc_settings_path.php file. This file resides in web folder of WebMail Pro installation.

Please note that $dataPath refers to the physical path (e.g. /var/SomeFolder), NOT virtual path (e.g. http://www.server.com/somefolder). In other words, $dataPath denotes the path where the data folder physically resides on the file system of the server. Moreover, to prevent unauthorized access from the web, it’s recommended to have data folder in the place which does not correspond to any virtual folder at all and cannot be accessed with http:// or https:// syntax.
<?php
    $dataPath = '/var/webmail-data';
?>
If you’re on shared hosting server, you often do not know absolute physical path to the root folder of your hosting space on the file system of the server. However, you can still use relative physical path, see Example 2. Relative path must specify the location of WebMail Pro data folder relatively to WebMail Pro web folder so that scripts from web folder could find data folder using this path.

Also, it's actually possible to have WebMail Pro web and data folders in the same folder. For instance, you may need to keep WebMail Pro web and data folders together if your shared hosting provides only web folder and all the space is visible from the web.

For instance, let’s assume "/" folder is the root of your shared hosting account (corresponds to http://your-shared-hosting.com/ virtual path), and you copied the contents of web folder of WebMail Pro package into /webmail and data folder into /webmail-data. See Example 3 on how to specify $dataPath.

Although you can use such configuration, you should prevent unauthorized access to webmail-data folder from the web. Disable web access to the /webmail-data folder in the settings of that folder in IIS manager.
 
Example 1. You use dedicated server hosting or installed WebMail Pro on your computer.
Let’s assume you’ve already created a virtual folder called webmail and mapped it to the physical folder /var/www/html/webmail-pro on the file system of your server. Then, you copied all the contents of web folder of WebMail Pro installation package into /var/www/html/webmail-pro folder.

Also, let’s assume you want to have data folder (where WebMail Pro will store settings and user data) in /var/www/webmail-pro-data location. You created a folder /var/www/webmail-pro-data and copied there all the contents of data folder of WebMail Pro installation package.

Now, open /var/www/html/webmail-pro/inc_settings_path.php file, find $dataPath parameter and change its value to /var/www/webmail-pro-data.
<?php
    $dataPath = '/var/www/webmail-pro-data';
?>
 
Example 2. You are on shared hosting and want to keep data folder separately for better security.
On shared hosting, you typically do not know the absolute physical path to your hosting space on the file system (HDD) of the server. In this case, you should use relative path for data folder. For instance, let's assume:
  • The root folder of your hosting account is called ftp and it contains the web folder which is visible from the web as http://shared-hosting.com/. However, ftp folder itself is NOT visible from the web, only its sub-folder web is.
  • In web folder of your hosting account, you created webmail sub-folder and placed the contents of web folder of WebMail Pro package there (so that the URL to the WebMail Pro will be http://your-shared-hosting.com/webmail).
Let's put data folder in ftp folder (which is not visible from the web). To distinguish our data folder from any folders of other applications, let's call it webmail-data. Now, we should specify the relative path to travel from ftp/web/webmail folder into ftp/webmail-data folder. Since ftp folder is two-levels up to ftp/web/webmail folder, we need to:
  • go up two levels (../..) to return to ftp level
  • then go down /webmail-data level.
Thus, the relative path will be ../../webmail-data. When a script which resides in ftp/web/webmail folder, accesses a file under the path ../../webmail-data/somefile, it finds that file in ftp/webmail-data/ folder.
<?php
    $dataPath = '../../webmail-data';
?>
 
Example 3. You are on shared hosting and want to keep web and data folder in the same place.
Let’s assume you have data and web folders in the same folder and have already secured data folder using your web server settings. For instance, /webmail is web folder and /webmail-data is data folder. The relative path from /webmail to /webmail-data will be ../webmail-data.
<?php
    $dataPath = '../webmail-data';
?>
 

2.2.  I'm getting 'WebMail is not configured properly' error. What's wrong? (Windows only)

This error usually occurs due to the following reasons:
  • The path to WebMail Pro data folder has not been specified. See below how to specify it.
  • The specified data folder location could not be accessed by WebMail Pro application (typically, insufficient permissions for Internet Guest Account user to access data folder). Read More
WebMail Pro installation consists of two main folders: web and data. The web folder contains the WebMail Pro application itself. The data folder stores settings, temporary files, etc. You will usually place web and data folders into different locations on the server because web folder must be visible to everyone (i.e. you can access it from the web via HTTP or HTTPS) whereas data folder must be not (i.e. only WebMail Pro scripts should have access to this folder as it contains private data of your mail users).

To let WebMail Pro application know where you placed data folder, you should specify the path to data folder in $dataPath value of inc_settings_path.php file. This file resides in web folder of WebMail Pro installation.

Please note that $dataPath refers to the physical path (e.g. C:\SomeFolder), NOT virtual path (e.g. http://www.server.com/somefolder). In other words, $dataPath denotes the path where the data folder physically resides on the file system of the server. Moreover, to prevent unauthorized access from the web, it’s recommended to have data folder in the place which does not correspond to any virtual folder at all and cannot be accessed with http:// or https:// syntax.
<?php
    $dataPath = 'C:\WebMail\data';
?>
If you’re on shared hosting server, you often do not know absolute physical path to the root folder of your hosting space on the file system of the server. However, you can still use relative physical path, see Example 2. Relative path must specify the location of WebMail Pro data folder relatively to WebMail Pro web folder so that scripts from web folder could find data folder using this path.

Also, it's actually possible to have WebMail Pro web and data folders in the same folder. For instance, you may need to keep WebMail Pro web and data folders together if your shared hosting provides only web folder and all the space is visible from the web.

For instance, let’s assume "/" folder is the root of your shared hosting account (corresponds to http://your-shared-hosting.com/ virtual path), and you copied the contents of web folder of WebMail Pro package into /webmail and data folder into /webmail-data. See Example 3 on how to specify $dataPath.

Although you can use such configuration, you should prevent unauthorized access to webmail-data folder from the web. Disable web access to the /webmail-data folder in the settings of that folder in IIS manager.
 
Example 1. You use dedicated server hosting or installed WebMail Pro on your computer.
Let’s assume you’ve already created a virtual folder called webmail and mapped it to the physical folder C:\Inetpub\wwwroot\webmail-pro on the file system of your server. Then, you copied all the contents of web folder of WebMail Pro installation package into C:\Inetpub\wwwroot\webmail-pro folder.

Also, let’s assume you want to have data folder (where WebMail Pro will store settings and user data) in C:\data\webmail-pro-data location. You created a folder C:\data\webmail-pro-data and copied there all the contents of data folder of WebMail Pro installation package.

Now, open C:\Inetpub\wwwroot\webmail-pro\inc_settings_path.php file, find $dataPath parameter and change its value to C:\data\webmail-pro-data.
<?php
    $dataPath = 'C:\data\webmail-pro-data';
?>
 
Example 2. You are on shared hosting and want to keep data folder separately for better security.
On shared hosting, you typically do not know the absolute physical path to your hosting space on the file system (HDD) of the server. In this case, you should use relative path for data folder. For instance, let's assume:
  • The root folder of your hosting account is called ftp and it contains the web folder which is visible from the web as http://shared-hosting.com/. However, ftp folder itself is NOT visible from the web, only its sub-folder web is.
  • In web folder of your hosting account, you created webmail sub-folder and placed the contents of web folder of WebMail Pro package there (so that the URL to the WebMail Pro will be http://your-shared-hosting.com/webmail).
Let's put data folder in ftp folder (which is not visible from the web). To distinguish our data folder from any folders of other applications, let's call it webmail-data. Now, we should specify the relative path to travel from ftp\web\webmail folder into ftp\webmail-data folder. Since ftp folder is two-levels up to ftp\web\webmail folder, we need to:
  • go up two levels (..\..) to return to ftp level
  • then go down \webmail-data level.
Thus, the relative path will be ..\..\webmail-data. When a script which resides in ftp\web\webmail folder, accesses a file under the path ..\..\webmail-data\somefile, it finds that file in ftp\webmail-data\ folder.
<?php
    $dataPath = '..\..\webmail-data';
?>
 
Example 3. You are on shared hosting and want to keep web and data folder in the same place.
Let’s assume you have data and web folders in the same folder and have already secured data folder using your web server settings. For instance, /webmail is web folder and /webmail-data is data folder. The relative path from /webmail to /webmail-data will be ..\webmail-data.
<?php
    $dataPath = '..\webmail-data';
?>
 

3.1. Administration settings disappeared / are not saved. Why? (Linux/Apache only)

This means Apache process (which executes WebMail) has insufficient permissions to the WebMail PHP data folder (its location is specified in inc_setting_path.php file). If the Apache process is owner of all contents of the data folder, you should assign the following permissions:
  • 755 for the data folder and all subfolders
  • 644 for all files in the data folder and all subfolders.
If you have SSH or direct access to your server, you can do this as follows:
  • Navigate to the WebMail data folder to make it the current folder;
  • Run find . -type d -exec chmod 755 {} \;
  • Run find . -type f -exec chmod 644 {} \;
Otherwise, you can manually assign these permissions through FTP (most FTP clients and servers support remote assigning of permissions).

If the Apache process is not owner of all contents of the data folder, the permissions should be:
  • 777 for the data folder and all subfolders
  • 666 for all the files in the data folder and all subfolders.
 

3.2. Administration settings disappeared / are not saved. Why? (Windows/IIS only)

This means Internet Guest Account on your server has insufficient permissions to the WebMail data folder (its location is specified in inc_setting_path.php file). Please complete the steps below to grant the appropriate permissions:
  • using Windows Explorer, navigate to the folder which contains the data folder;
  • in context menu, choose "Properties" of the data folder and "Security" tab;
  • add Internet Guest Account (usually IUSR_) into the list;
  • tick "Allow full control" checkbox to grant permissions and press "OK".
 

4.  Error while attaching files to new message. Please advice.

Common problem with attachments is insufficient permissions for attachments folder which is located in the data folder. Please refer to topic #3 to learn how to grant necessary permissions.

Another typical reason of this issue is that attachments size is limited in PHP configuration. To increase the limit, open your php.ini file and locate the following lines:
  • upload_max_filesize = 2M
  • post_max_size = 8M
You should set these limits according to your needs, but post_max_size should be equal to at least upload_max_filesize * 2.

Also, if you use IIS 6, size of a file that can be uploaded onto the server is limited to 200K by default. You can increase this limit according to you needs. To do this, type "notepad %WINDIR%\system32\inetsrv\MetaBase.xml" in command line, search for the "AspMaxRequestEntityAllowed" property, and specify necessary size in bytes, then save this file. Please note, "Enable Direct Metabase Edit" must be turned on, in other case, you will be not able to edit this file. To check this option, look at your web host properties in Internet Information Services (IIS) Manager.
 

5.  I can't see embedded graphics while viewing HTML-formatted email message. Any suggestions?

See topic #4.
 

6.  Synchronization modes. How do they work?

WebMail Pro can download e-mail messages (or their parts) from mail servers and store the downloaded messages in its storage. This is some kind of cache which reduces number of connections to the mail server and increases performance in most cases. E.g. if the entire message is stored in WebMail Pro storage and you need to view it, WebMail Pro won't connect to the mail server, it'd retrieve message data from its storage instead. Moreover, you can configure WebMail Pro to delete messages from mail servers once they have been placed in the storage and that would increase free space in your mailboxes.

Let's clarify what WebMail storage is. That's a place on the filesystem or in database where WebMail Pro stores messages (or their headers only) downloaded from the mail server. By default, messages are stored on the filesystem, but you can make them get saved into database instead via changing <StoreMailsInDb>0</StoreMailsInDb> to 1 in \DATA\Settings\settings.xml. It's IMPORTANT to change this setting when the storage is empty (i.e. no messages have been yet downloaded into any of existing WebMail Pro accounts). Otherwise, all the messages already downloaded would have become unreadable.

Synchronization modes (sync modes) determine how folders in WebMail storage are synchronized with the appropriate folders on the mail server. Different sync modes can be set for each folder of an IMAP account (Manage Folders screen). However, in case of POP3 account, you can set sync mode for Inbox folder only as POP3 protocol doesn't provide folders other than Inbox, all other folders only exist in WebMail Pro storage, NOT on the mail server. Sync modes are:

Don't synchronize: this folder in WebMail Pro storage doesn't depend on any folder on the mail server, messages will not be downloaded from the mail server into that folder when you click Check Mail. However, if you set up some filters for other folders which make downloaded e-mails transferred into this folder, e-mails may appear in this folder even if its status is set to Don't synchronize.

Direct Mode: WebMail Pro accesses messages directly in the folder on the mail server, neither message headers nor entire messages are stored in WebMail Pro own storage. Some advanced features like search, sorting, filtering are not available in this mode as they cannot work without WebMail Pro storage. This limitation is set by POP3 and IMAP protocols which provide less features than WebMail Pro storage.

Headers Only: WebMail Pro downloads and stores only message headers when you press "Check Mail" button. These headers are used for displaying message list, sorting, filtering and search. However, search works for headers only. When you need to view the message body or its attachments, WebMail Pro downloads the entire message from the mail server and displays it but doesn't place it into the storage.

Entire Messages: entire messages are downloaded and stored in WebMail Pro storage on "Check Mail". This mode provides all the features. Stored messages are used for all the operations including search in entire messages. WebMail Pro never re-downloads messages which have already been downloaded.

For IMAP accounts, Headers Only and Entire Messages modes have two submodes: All Headers/New Headers and All Messages/New Messages. The difference is that New Headers/Messages downloads only new headers/messages while All Headers/Messages modes additionally synchronize flags for messages downloaded in the past. All Headers/Messages mode is useful for IMAP accounts which are accessed not only via WebMail Pro, but also via other e-mail clients (e.g. Outlook Express, Mozilla Thunderbird). If you read a message via another e-mail client, it's marked as "seen" on the IMAP server. To get its "seen" status in WebMail Pro, it's necessary to synchronize the flags.

With sync modes, you can distribute working load and disk space consumption between the mail server and WebMail Pro storage. Direct mode - more load on the mail server, Entire Messages - more load on WebMail storage, Headers Only - the golden mean. We recommend using Headers Only in most cases, but if you need to fully migrate messages to WebMail Pro storage (i.e. delete messages from the mail server after downloading) or/and search in message bodies, you should use Entire Messages mode.

Changing sync mode is not available for XMail accounts type (available if you use AfterLogic MailSuite Pro bundle), All Headers mode is used. Message bodies and attachments are accessed in AfterLogic XMail Server Pro storage directly. This account type provides the best performance due to direct access to mail storage without POP3/IMAP connections.
 

7.  How to connect to gmail.com?

Gmail requires establishing secure connections (SSL/TLS). AfterLogic WebMail supports SSL/TLS and can connect to Gmail.



To connect to servers like gmail.com, you should just specify dedicated SSL ports, SSL/TLS mode will be enabled automatically. The ports are: 465 (SMTP), 995 (POP3), 993 (IMAP).

You also need to enable POP/IMAP access in your Gmail account configuration as shown at:



If you access to your Gmail account through POP3 and use sync mode different from Entire Messages, it's important to set "keep Gmail's copy in the Inbox", otherwise, messages would disappear from your WebMail Pro account or you'd get "Message deleted from server" error.
 

8.  How to change WebMail logo?

You should modify styles.css file of the appropriate skin. Let's take Hotmail_Style for example.

The following class defines the logo height and the logo image source. Actually, the height of the default logo is greater than 58px (it's obvious on the login screen), that's why it's defined in wm_content style, but wm_logo style just limits its height:
.wm_logo
{
        height: 58px;
        border: 0;
        overflow: auto;
}
Remove or change the logo image:
.wm_content
{
        background: url(header.jpg) no-repeat center top;
}
The following class creates a gradient which smoothly blends the logo with the background:
body
{
        margin: 0;
        padding: 0;
        width: 100%;
        background: #336699 url(gradient.jpg) repeat-x top;
}
 

9.  Fatal error: Allowed memory size of [###] bytes exhausted (tried to allocate [###] bytes) in [path]/[file].php on line [###]

This error caused by limitation of memory available for PHP script. Increase memory_limit PHP configuration setting (see the [PHP manual]). After editing the PHP configuration file, you will probably need to restart your web server. Check your server manual to find out how to do that. You should add the following line (or change existing) into your php.ini file:
  • memory_limit = 60M
We recommend you to specify not less than 50M because large messages require additional memory for processing.
 

10. I'm getting "Can't connect to POP3 server, check POP3 server settings". How to resolve?

To learn what is mail server and what is necessary to send/receive messages, please refer to this topic.

Typical reasons:
  • the mail host you try to connect to doesn't have POP3 service running;
  • a firewall/antivirus application (installed on the workstation/server WebMail is installed on) doesn't allow WebMail to connect to the POP3 server.
Make sure POP3 server address is specified correctly. You may try to connect to the same POP3 server via another e-mail client like Outlook Express or Mozilla Thunderbird to make sure it works. Also, you should configure your firewall/antivirus to allow WebMail to send/receive messages through SMTP/POP3 (25 and 110 ports). To learn if the issue is caused by the firewall/antivirus, just temporarily disable it for test purpose and try to reproduce the issue.

Also, many smart antiviruses/firewalls have whitelists which contain well known software like Outlook Express. Due to this, such whitelisted software may be allowed to connect to POP3/SMTP servers while WebMail not. If your antivirus/firewall supports such a list, just add MailBee WebMail there.
 

11. How to translate WebMail interface to another language?

It's easy to translate WebMail interface to any language (let's take Spanish for example):
  1. Make sure the text editor you use supports UTF-8 because all text in WebMail Pro language files is in UTF-8 charset. It's very important to use a text editor in UTF-8 mode because otherwise some characters might be displayed incorrectly for those users which have another language set as default system language. You can use standard Windows Notepad because it supports UTF-8.
  2. Open webmailphp\web\lang\English.php and save this file as [language].php, where [language]=Spanish is for Spanish destination language (e.g. Spanish.php)
  3. Translate [language].php to destination language (e.g. translate Spanish.php to Spanish)

We'd be very grateful to you if you provide us with the translation to include it to the original WebMail package among with other translations provided by our customers.

To learn how to translate ASP.NET version of WebMail Pro, please refer to WebMail Pro ASP.NET FAQ.
 

12. Sort and/or search feature doesn't work. Why?

That's because your POP3 account or current IMAP folder is in "Direct Mode" sync mode. In this mode, WebMail Pro accesses messages directly on the mail server without downloading them to database. POP3 protocol doesn't support sort/search on the server-side, IMAP supports that in theory but most implementations don't work reliably. To get sort/search working, select another sync mode:
  • All Headers / New Headers - sort and search work, but you can search in message headers only;
  • All Messages / New Messages - sort and search (in message headers and bodies) work.
 

13. Is WebMail Pro shipped with the full source code? Can I modify it?

Yes, AfterLogic WebMail Pro PHP is shipped with the full source code and you're free to modify it to implement any feature you need.

If you're about to implement a feature in user interface, don't forget that AfterLogic WebMail Pro provides two modes of user interface: AJAX (default mode, but can be disabled) and classic HTML (enabled automatically for old AJAX-incompatible browsers), so you should take care of implementing the feature in both the modes.

Also, AfterLogic WebMail Pro supports skins engine and you can easily create your own skin or modify any of the existing ones.

Please note that we only support original product functionality. Product modifications are the responsibility of the client, and once the product is modified by the client, we can not support a customized product. All issues that fall outside of answering questions related to our unmodified products must be addressed to our Professional Services team.