Windows Firewall - hMailServer Portsettings Howto

This section contains user-submitted tutorials.
Post Reply
User avatar
Dravion
Senior user
Senior user
Posts: 1489
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Windows Firewall - hMailServer Portsettings Howto

Post by Dravion » 2018-06-30 21:20

This little howto is intended to make sure all by hMailServer required ports are open if you have any Windows Firewall related connectionproblems.This can be helpfull because durning the Windows installation you have to decide if your want to apply Home/Work or Public Network access settings to your Computer.If you choose for example "Home" nothing will be blocked at all but if you choose for instance "Public" any ports will be closed by default.

Lets begin:
Open the Windows Command prompt as admin and type in the following Netshell commands to open the required ports for hMailServer
PS: We only discuss the officially recommended encrypted ports for Mailtransport.

Email-Sendingpart:
  • SMTP (required for hMailserver for send and receive Emails from and to the Internet)
    netsh advfirewall firewall add rule name="SMTP" dir=in action=allow protocol=TCP localport=25
    netsh advfirewall firewall add rule name="SMTP" dir=out action=allow protocol=TCP localport=25
  • Submission (required if your hMailServer is configured for STARTTLS MailApp sent access)
    netsh advfirewall firewall add rule name="Submission" dir=in action=allow protocol=TCP localport=587
    netsh advfirewall firewall add rule name="Submission" dir=out action=allow protocol=TCP localport=587
  • SMTPS (required if your hMailServer is configured for SSL/TLS MailApp sent access - could be necessary for example: MS-Outlook)
    netsh advfirewall firewall add rule name="SMTPS" dir=in action=allow protocol=TCP localport=465
    netsh advfirewall firewall add rule name="SMTPS" dir=out action=allow protocol=TCP localport=465
Email-Receivingpart:
  • IMAPS (required if you want to use your MailApp to view Emails via SSL/TLS from your hMailServer)
    netsh advfirewall firewall add rule name="IMAP" dir=in action=allow protocol=TCP localport=993
    netsh advfirewall firewall add rule name="IMAP" dir=out action=allow protocol=TCP localport=993
  • POP3S (required if you want to use your MailApp for download and delete serverside Emails via SSL/TLS from hMailServer)
    netsh advfirewall firewall add rule name="POP3S" dir=in action=allow protocol=TCP localport=995
    netsh advfirewall firewall add rule name="POP3S" dir=out action=allow protocol=TCP localport=995
Info:
Take a look if the above Netsh commands are executed correctly and the response is allways "OK". If not, this indicates a diffrent Windows Firewallrule with the same name is allready in affect or your Windows Firewall simply isnt running.

tunis
Normal user
Normal user
Posts: 226
Joined: 2015-01-05 20:22
Location: Sweden

Re: Windows Firewall - hMailServer Portsettings Howto

Post by tunis » 2018-07-02 10:09

I open ports by program.

netsh advfirewall firewall add rule name="hMailServer" dir=in program="c:\pathtohmailserver\bin\hmailserver.exe" action=allow
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

User avatar
mattg
Moderator
Moderator
Posts: 20299
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Windows Firewall - hMailServer Portsettings Howto

Post by mattg » 2018-07-02 12:31

Opening by ports is much safer. The 'program' may answer to remote admin commands in some circumstances.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply