📜 ⬆️ ⬇️

Roundcube + hMailServer or own mail in a small organization

image
Not every organization can afford to purchase an expensive mail server like Microsoft Exchange Server, and because of its “tricky”, not every organization needs it. Some time ago, I was faced with the task of launching mail within an organization to exchange documents between departments. At once I will make a reservation that the organization in which I work is small, has 1 server and about 50 client machines. The experience of working with mail servers is not. After a brief search across the expanses of the network, it was decided to use the RoundCube + hMailServer combination. This article will not review and describe all the strengths and weaknesses of such a bundle, but simply describe how to make it all work, but I will say that the main advantages of this solution are free and easy to set up.

A bit of theory


What are we dealing with ...
Mail server - in the e-mail forwarding system, the so-called message transfer agent is usually called. This is a computer program that transmits messages from one computer to another. Typically, the mail server works behind the scenes, and users deal with another program — the email client.
hMailServer is a free mail server for the Windows platform. Runs as a Windows service and includes administration and backup tools. Supports IMAP, POP3 and SMTP mail protocols. To store settings and indexes, it uses databases like MySQL, MS SQL or PostgreSQL, and the email messages themselves are stored on the hard disk in MIME format.
RoundCube Webmail is a web-based e-mail client written in PHP using CSS and XHTML and AJAX technology. RoundCube Webmail is installed on almost any server with PHP and MySQL support 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, having downloaded everything you need or having made sure that it is available, you can safely proceed to the beginning of the installation.

Practice


Stage Zero: Set the network card with a static IP address. This article will use IP 192.168.0.45 .
')
Step One: Install VertrigoServ.
I don’t think it’s worthwhile to detail the installation of this web server, since There is nothing intricate in this process.

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

image

Consider setting up the connection 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 in order to avoid any problems at step 6, copy the libmysql.dll file located in the folder with the installed VertrigoServ to the \hMailServer\Bin\ folder
Step 4 of 7 - 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 correct, a database is created)
Step 7 of 7 - “Close”
The final step in installing hMailServer is the “Specify main password”, which sets the “master” password to access the program. After the password is set, the installation is considered complete.

Now let's do the Russification of the program, if you think that your knowledge of English is enough to work with the program, feel free to skip this item. For Russification, it is necessary to temporarily stop the hMailServer service, for this we go to “Start - Control Panel - Administration - 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 place it in the \hMailServer\Languages\ folder. It remains only to enter the name of the localization file in the hMailServer configuration file. To do this, open the \hMailServer\Bin\hMailServer.ini file and add «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.
Run the hMailServer Administrator utility. The “Connect” window appears, in which, selecting the single entry, click on the “Connect” button

image

The program asks you to enter a password, which was set at the final stage of the hMailServer installation. Entering the password, we get to the main window of the administrative part of hMail. In the menu "File - Select language ..." choose "russian" and click "OK", the program will automatically restart, after which it will "speak" in Russian.
The setting is intuitive, first you need to click on the "Add domain" button, select " test.loc " as the domain name, and click the "Save" button (more detailed setting of the mail domain in this article will not be considered).

image

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

image

Actually, on this hMailServer pre-configuration can be considered complete, go on.

Stage Four: Installing RoundCube.
First you need to transfer the contents of the roundcubemail archive to the \VertrigoServ\www\ folder (you can remove all the “stuffing” beforehand). Now in the phpMyAdmin web application we create a MySQL database for RoundCubeMail, to do this, open a browser and enter “ 127.0.0.1/phpmyadmin 127.0.0.1/phpmyadmin ”as a login, enter: root, password: vertrigo (standard credentials for VertrigoServ). In the “New Database” field, enter a name, for example, “roundcube” and press 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 127.0.0.1/installer/index.php ”and click“ Enter ”. Once on the “Roundcube Webmail Installer” page, click the “Start installation” button. Installation takes place in three stages.
1. Check environment . There is a check whether your system meets the requirements of the script. Click the button “Next” if it is not available, carefully read the information on the page and correct the shortcomings.

image

2. Create config . Consider the points to set / change.
General configuration block:
product_name –

Database setup block:
Database type – MySQL
Database server – localhost
Database name – roundcube
Database user name – root
Database password – vertrigo


IMAP Settings block:
default_host – 192.168.0.45
username_domain – test.loc


SMTP Settings block:
smtp_server – localhost

Display settings & user prefs block:
language – ru_RU

After you have made all the necessary changes, click on the “Create config” button to redirect us to the page where you are invited to download the created configuration files.

image

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

Step Five: Log in to Roundcube.
This stage is final, here we will log in under the login details of the user that was created in the third stage, test@test.loc. To begin, open the browser and enter in the address bar 192.168.0.45 192.168.0.45 , clicking "Enter" we get to the authorization page Roundcube. In the “Username” field, enter test@test.loc or just test. We enter the password that was 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 bundles RoundCube + hMailServer. Thank you for reading to the end!

Source: https://habr.com/ru/post/131179/


All Articles