Roundcube + hMailServer or your own mail in a small organization

image
Not every organization can afford to buy an expensive mail server like Microsoft Exchange Server, and because of its "tricked out", not every organization needs it. Some time ago, I was faced with the task of launching mail within an organization for exchanging documents between departments.Immediately make a reservation that the organization in which I work is small, has 1 server and about 50 client machines. Experience with mail servers - no. After a brief search of the network, it was decided to use a bunch of RoundCube + hMailServer. This article will not consider and describe all the strengths and weaknesses of such a bundle, but simply describes how to make it all work, but I will say that the main advantages of this solution are free and easy to configure.

Bit of theory


What are we dealing with ...
Mail server - in the e-mail forwarding system, this is usually called the message forwarding agent. This is a computer program that transmits messages from one computer to another. Typically, the mail server works behind the scenes, and users are dealing with another program - the email client.
hMailServer is a free mail server for the Windows platform. Works as a Windows service and includes administration and backup tools. Supports IMAP, POP3, and SMTP mail protocols. It uses databases such as MySQL, MS SQL or PostgreSQL to store settings and indexes; mail messages themselves are stored on the hard disk in MIME format.
RoundCube Webmail- This is a web-based email client written in PHP using CSS and XHTML and AJAX technology. RoundCube Webmail is installed on almost any server with support for PHP and MySQL and provides the ability to work with mailboxes using IMAP and SMTP protocols. It has many extensions.
To get started, you need to download the following components:
1) hMailServer
2) RoundCube Webmail
3) VertrigoServ web server (you can use any other)
And so, after downloading everything you need or making sure that it is available, you can safely proceed to the installation.

Practice


Stage zero: Set the network card to a static IP address. This article will use IP 192.168.0.45.

Stage One: Installing VertrigoServ.
I don’t think it’s worth detailing the installation of this web server, as There is nothing intricate in this process.

Step Two: Install hMailServer.
I will not completely describe the installation process, we will consider only the main points. At the “Select Components” stage, select “Full Installation”, then at the “Database type” stage, select “Use external database engine (MSSQL, MySQL or PostgreSQL) and clicking the“ Next ”button a couple of times will begin the installation. Toward the end of the installation, the hMailServer Database Setup application starts, in which you need to specify the type of database and specify the details for the connection.

image

Let’s take a look at the connection setup step by step:
    Step 1 of 7 - just click “Next”
    Step 2 of 7 - select “Create a new hMailServer database”
    Step 3 of 7 - select “MySQL” and to avoid problems at step 6, copy the libmysql.dll file located in the folder with VertrigoServ installed in the \hMailServer\Bin\
    Step 4 of 7 folder - enter the following data:
Database server address - 127.0.0.1(or localhost)
Port - 3306
Database name - hmail (as an example)
Username - root
Password - vertrigo
    Step 5 of 7 - skip
    Step 6 of 7 - just click “Next” (provided that the data in step 4 is entered correctly, the database is created)
    Step 7 of 7 - “Close”
The final step in installing hMailServer is the “Specify main password”, which sets the “main” password for accessing the program. After the password is set, the installation is considered complete.

Now we will engage in the Russification of the program, if you think that your knowledge of English is enough to work with the program, then feel free to skip this item. For Russification, it is necessary to temporarily stop the hMailServer service; for this, go to "Start - Control Panel - Administrative Tools - Services". In the list we find hMailServer, right-click the drop-down menu in which we select the “Stop” command.

image

Everything, the service is stopped. Now download the file with Russification and put it in the folder\hMailServer\Languages\. It remains only to enter the name of the localization file in the hMailServer configuration file, for this we open the file \hMailServer\Bin\hMailServer.iniand add it «ValidLanguages=english,swedish,russian». Save and close the file. We start the hMailServer service (right-click the drop-down menu in which we select the "Start" command).

Step Three: Initial Configuration of hMailServer.
Launch the hMailServer Administrator utility. The “Connect” window appears, in which, having selected a single entry, click on the “Connect” button.

image

The program asks for the password that was set at the final stage of installing hMailServer. Having entered the password, we get into the main window of the administrative part of hMail. In the menu “File - Select language ...” we select “russian” and click “OK”, the program will automatically restart, after which it will “speak” in Russian.
The setup is intuitive, first you need to click on the “Add domain” button, select “ test.loc ” as the domain name and click on the “Save” button (more detailed configuration of the mail domain will not be considered in this article).

image

We create an account, for this we go to the "Accounts" folder on the left side of the program, and on the right side of the program click the "Add ..." button. Enter any user name (for example test), specify the password and click the "Save" button (more detailed user settings will not be considered in this article). And so, the first user test@test.loc appears on our mail server .

image

Actually, the preliminary configuration of hMailServer can be considered completed, go on.

Step Four: Install RoundCube.
First you need to transfer the contents of the roundcubemail archive to a folder \VertrigoServ\www\(you can delete the entire "stuff" first). Now in the phpMyAdmin web application we create a MySQL database for RoundCubeMail, for this we open a browser and enter “ 127.0.0.1/phpmyadmin” in the address bar, enter: root, password: vertrigo (standard details for VertrigoServ). In the “New database” field, enter a name, for example, “roundcube” and click the “Create” button.

image

The database is created, go directly to the installation of the RoundCubeMail script. In the address bar of the browser, enter " 127.0.0.1/installer/index.php" and press "Enter". Once on the page "Roundcube Webmail Installer" click on the button "Start installation". Installation takes place in three stages.
1. Check environment. It checks to see if your system meets the requirements of the script. Click the “Next” button, if it is not available, carefully read the information on the page and correct the shortcomings.

image

2. Create config . Consider the items that should be set / changed.
General configuration
product_name – Имя почтового сервера

block : Database setup block : IMAP Settings block : SMTP Settings block : Display settings & user prefs block: After you have made all the necessary changes, click on the “Create config” button and we will be redirected to the page on which it is proposed to download the created configuration files. Download the generated configuration files and copy them to a folder . We return to the browser and click the "Continue" button. 3. Test config
Database type – MySQL
Database server – localhost
Database name – roundcube
Database user name – root
Database password – vertrigo



default_host – 192.168.0.45
username_domain – test.loc



smtp_server – localhost


language – ru_RU



image

\VertrigoServ\www\config\
. This is the final stage of the installation, on it you can check the correct configuration. To do this, the hMailServer service must be running.
In the “Test SMTP config” block, in the “Sender” and “Recipient” fields, enter the address of our only user test@test.loc, click on the “Send test mail” button, if the message “SMTP send: OK” appears, this means configured correctly, otherwise double-check the parameter in the configuration file main.inc.php $rcmail_config['smtp_server'] = 'localhost';.
Now we check whether IMAP works, in the “Test IMAP config” block, select 192.168.0.45 as the server, Username: test@test.loc, Password: password that was entered when creating the user. Click on the “Check login” button, if as a result we get the message “IMAP connect: OK” then everything is configured correctly, otherwise double-check the parameter in the configuration file main.inc.php $rcmail_config['default_host'] = '192.168.0.45';.
After making sure that everything works, go to the directory \VertrigoServ\www\and delete the “Installer” folder.
This completes the installation of RoundCube Webmail.

Step Five: Log in to Roundcube.
This stage is final, here we are authorized under the details of the user who was created at the third stage test@test.loc. First, open the browser and enter in the address bar192.168.0.45By pressing “Enter” we get to the Roundcube login page. In the "Username" field, enter test@test.loc or just test. Enter the password you entered when creating the user. Click on the “Login” button and find yourself inside your first mailbox!

image

That's all. This article describes the basic settings for the RoundCube + hMailServer bundle. Thank you for reading to the end!

Also popular now: