Practical Application of Intranet Penetration - How to Remotely Send Mail Service of Personal Locally Built hMailServer Through Intranet Penetration

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

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

1. Install hMailServer

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

image-20230615132311650

After downloading, open the exe file to install, just click Next to go to the next step, to set a password step, we set a password, and then Next to complete the installation

image-20230615132651836

2. Set up hMailServer

Above we have completed the installation of hMailServer, now set the mail name and add an account, open hMailServer, click connectto connect to the local service

image-20230615150942081

Prompt to enter a password, the password is the password we set above, enter and click ok

image-20230615151054889

After entering, we first need to add a mail subject name, clickAdd domain

image-20230615151340469

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

image-20230615151601936

Add it to add an account, click Domains, then click Accounts under the main name of the domain name we set above, enter and click Add on the right to add an account

image-20230615151856984

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

image-20230615152037671

In the same way, let's create another one for easy testing, and the two names should not be repeated

image-20230615152243913

After the setting is complete, we can see that there are two users in the list, and the server is set up

image-20230615153831801

3. Client installation to add account

Above we have set up our own local mail service, now we install the client test, install a Foxmail client here for testing, enter the official website to download: https://www.foxmail.com/

image-20230615154202318

After downloading and installing, open Foxmail after the installation is complete, we add an email account, click on other emails

image-20230615154342472

Click on manual settings

image-20230615154415198

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

image-20230615154549383

After adding the account successfully, 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 regularly receive mail, 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

image-20230615155356233

After creation, we also check the button to receive emails from time to time, click Apply, and the account is added

image-20230615155500479

4. Test send email

We added two accounts in Foxmail above, now test sending emails, select an account, click write 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 we can see the email we sent. If the click does not come out, you can wait for 10 seconds and click again. The local test sending email is completed. Next, we configure the remote sending email

image-20230615155920888

5. Install cpolar

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

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

image-20230615161202668

6. Create a public address

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

20230106104443

After successful login, click Tunnel Management on the left - Create Tunnel, we first create the first tunnel, this tunnel is the mail receiving tunnel:

  • Tunnel name: receive mail
  • Protocol: select tcp protocol
  • Local address: 110 (mail receiving port of the server)
  • Port Type: Random ephemeral TCP port
  • Region: China VIP

click创建

image-20230615161918672

Create a second tunnel, send mail tunnel

  • Tunnel name: send mail
  • Protocol: select tcp protocol
  • Local address: 25 (the email port of the server)
  • Port Type: Random ephemeral TCP port
  • Region: China VIP

image-20230615162120992

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

image-20230615162334562

7. Test sending mail remotely

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

image-20230615162529785

Then set the addresses of the receiving server and the sending 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 mistakes. After entering, click Apply.image-20230615162707419

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

image-20230615163552597

You can see that another receiving has been completed, and friends in the distance can send you an email by adding an account in this way

image-20230615171219912

8. Fixed connection public network address

It should be noted that the above steps use the random temporary tcp port address of cpolar, 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, which will not change, and there is no need to modify the address repeatedly every day after setting.

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

Log in to the official website of cpolar, click Reserved 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

Reserve the address for the second send mail:

  • Region: Select China
  • Description: sending email address

click保留

image-20230615172209998

After the address is successfully reserved, the system will generate a corresponding fixed public network address, copy the two addresses, remember to distinguish them here, and don’t confuse them

image-20230615172330065

Enter the cpolar web ui management interface, click the tunnel management on the left dashboard - tunnel list, find the tcp tunnel we created above to receive emails, and click on the right编辑

image-20230615172452983

Modify the tunnel information, and configure the fixed tcp address of the official website to reserve the successful receiving email address in the tunnel

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

click更新

image-20230615172622769

Then edit the second tunnel for sending emails

image-20230615172815520

Similarly, configure another fixed address for sending mail to the corresponding sending mail 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 the fixed remote address to send mail

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

image-20230615173050969

We replace the addresses of the receiving server and the sending server with the fixed addresses we set on the official website of cpolar. Remember not to reverse the addresses. The port corresponds to the port of the address. After setting, click Apply

image-20230615173208904

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

image-20230615173532649

We can see that the email is sent successfully, and another account also receives it successfully, so that our own email service is set up, and emails can be sent remotely at the same time.

image-20230615173643578

Reprinted from the cpolar pole cloud article: Build a personal hMailServer mail service to send mail remotely

Guess you like

Origin blog.csdn.net/weixin_42878111/article/details/132671642