Email service construction: Use hMailServer to build a personal email server to facilitate remote email sending

Preface

hMailServer is a mail server through which we can build our own mail service and send mail remotely through the cpolar intranet mapping tool. There is no need to use a public network server or a domain name, and the mail account name can be customized.

The following uses the Windows 10 system as the environment to introduce the usage:

1. Install hMailServer

Enter the official download: https://www.hmailserver.com/download, select the latest version, the browser may prompt you to report a virus when downloading, click Save

After downloading, open the exe file to install, just click Next to next step. When it comes to setting the password, we set a password, and then Next to complete the installation.

image-20230615132651836

2. Set up hMailServer

We have completed the installation of hMailServer above. Now set the email name and add an account, open hMailServer, and click connectto connect to the local service.

image-20230615150942081

You are prompted to enter a password, which is the password we set above. Click OK after entering it.

image-20230615151054889

After entering, we first need to add an email subject name, clickAdd domain

We can set this name at will, as long as it conforms to the standard format of a domain name, such as abc.com, 123.com, test.com, etc. We set it here for test.comtesting. After setting, click sava to save.

Add to add an account, click Domains, and then click Accounts below the main name of the domain name we set above. After entering, click Add on the right to add an account.

Enter the account name and password. We can customize the name. The account we create here is our email account, and the account and password are the account and password we use to log in to our email.

image-20230615152037671

In the same way, we create another one to facilitate testing. Do not repeat the two names.

After the setting is completed, we can see that two users appear in the list, and the server is set up.

image-20230615153831801

3. Client installation and adding account

Above we have set up our own local mail service. Now we install the client for testing. Here we install a Foxmail client for testing. Go to the official website to download: https://www.foxmail.com/

After downloading, install it. After the installation is completed, open Foxmail. We add an email account and click on other email addresses.

Click manual settings

On the page, we enter the account and password created above, fill in the local address of the server address:, 127.0.0.1other parameters are default, click Create after entering

image-20230615154549383

After successfully adding the account, we see our own account on the left, add the second account we created, and click Account Management under the left menu

image-20230615154857818

We see a button to receive emails regularly, uncheck it, and then click New

image-20230615155055159

Also select Other Emails - Manual Settings, enter the account password of the second email account we created above, and click Create

After creation, we also check the button to receive emails at a scheduled time, click Apply, and the account is added.

image-20230615155500479

4. Test sending email

We added two accounts in Foxmail above. Now to test sending emails, select an account and click to write an email.

image-20230615155644496

The recipient fills in another account of ours, then enters the content of the email and clicks send

image-20230615155806789

After the sending is completed, we click on the page to receive the email, and you can see the email we sent. If it does not come out after clicking once, you can wait 10 seconds and click again. The local test of sending the email is completed. Next, we configure the remote sending of the email.

image-20230615155920888

5. Install cpolar

cpolar official website: https://www.cpolar.com/

For Windows systems, you can directly download the zip package suitable for the Windows platform from the official website. After decompression, you will get the cpolar installation package, and then double-click the installation package to install it by default.

image-20230615161202668

6. Create a public network address

After cpolar is successfully installed, access the cpolar web UI management interface on the browser (default is local port 9200) and access it in the form of [http://local ip address:9200], such as http://127.0.0.1:9200/, And log in using cpolar account

20230106104443

After successfully logging in, click Tunnel Management on the left - Create Tunnel. We first create the first tunnel. This tunnel is a tunnel for receiving emails:

  • Tunnel name: receive mail
  • Protocol: Select tcp protocol
  • Local address: 110 (server’s mail-receiving port)
  • Port type: Random temporary TCP port
  • Region: China vip

Click创建

image-20230615161918672

Create a second tunnel, send email tunnel

  • Tunnel name: send email
  • Protocol: Select tcp protocol
  • Local address: 25 (server’s email port)
  • Port type: Random temporary TCP port
  • Region: China vip

image-20230615162120992

After the creation is successful, click on the status of the left dashboard - online tunnel list. You can see the two tunnels that have just been created successfully. One is for sending emails and the other is for receiving emails. The middle one is the corresponding public network address. Through this address we You can send emails remotely between two accounts.

image-20230615162334562

7. Test sending emails remotely

Open our Forxmail email client, find the account we added, and right-click Settings

image-20230615162529785

Then set the addresses of the incoming server and outgoing server. These two addresses are the two cpolar public network addresses we created above. The port corresponds to the port of the public network address. Remember not to make any mistakes. After entering, click Apply.image-20230615162707419

After the setting is completed, we use the account with the public network address to remotely send emails to another account.

image-20230615163552597

You can see that another reception has been completed. Friends from far away can send emails to you by adding accounts in this way.

image-20230615171219912

8. Fixed connection public network address

It should be noted that the above steps use cpolar random temporary TCP port address, and the generated public network address is a random temporary address, which will change randomly within 24 hours. Next, we configure a fixed TCP port address for it. This address will not change. After setting it, there will be no need to modify the address repeatedly every day.

cpolar official website: https://dashboard.cpolar.com/login

Log in to the cpolar official website, click Reserve on the left, find the reserved TCP address, and reserve the first address to receive emails:

  • Region: Select China
  • Description: Receiving email address

Click保留

image-20230615172113998

Keep the second sending email address:

  • Region: Select China
  • Description: Sending email address

Click保留

image-20230615172209998

After the address is successfully reserved, the system will generate the corresponding fixed public network address and copy the two addresses. Remember to distinguish them here so as not to confuse them.

image-20230615172330065

Enter the cpolar web ui management interface, click Tunnel Management - Tunnel List on the left dashboard, find the TCP tunnel we created above to receive mail, and click on the right编辑

image-20230615172452983

Modify the tunnel information and configure the fixed tcp address of the official website's successfully reserved email address into the tunnel.

  • Port type: modified to fixed tcp port
  • Reserved tcp address: fill in the receiving email address that is successfully reserved on the official website.

Click更新

image-20230615172622769

Then edit the second email tunnel

image-20230615172815520

Similarly, configure another fixed address for sending emails into the corresponding email tunnel.

image-20230615172739180

After the two tunnel settings are successfully updated, click the status on the left dashboard - Online Tunnel List, and you can see that the public network address has been updated to a fixed TCP address.

image-20230615172915503

9. Test sending emails from a fixed remote address

Similarly, we select one of the email accounts and right-click Settings

image-20230615173050969

We change the addresses of the incoming server and outgoing server to the fixed addresses we set on the cpolar official website. Remember not to reverse the addresses. The port corresponds to the port of the address. Once the settings are completed, click Apply.

image-20230615173208904

Then select this email address to send an email to another email account

We can see that the email was sent successfully and the other account received it successfully. In this way, our own email service is set up and emails can be sent remotely.

image-20230615173643578

Reprinted from cpolar pole cloud article: Build a personal hMailServer email service to send emails remotely

Guess you like

Origin blog.csdn.net/qq_25749749/article/details/132875642