Installguide: MS-SQLExpress 2017 and hMailServer 64-Bit

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

Installguide: MS-SQLExpress 2017 and hMailServer 64-Bit

Post by Dravion » 2018-06-25 01:17

This Guide will show you howto Install and configure hMailServer 5.6.7 (stable) 64-Bit on top of Windows 10 or Windows Server 2016 64-Bit
Operatingsystem with the free Microsoft SQL-Server Express 2017 Edition.We use Windows 10 Home Edition because it is the cheapist and most common version of Windows 10 nowdays but any other Edition of Win10 will work as well as long it is 64-Bit.We will install and recconfigure Windows Networking settings and use MS-SQL with Mixed Mode Authentication, so no Windows Authentication will be used in this Guide.Expect a bit of Command Prompt work, but dont worry, we will describe any details step by step.

PS: Microsoft SQL-Server is a state of the Art Enterprise Database and SQLExpress is its Lighversion. it has nothing to do with MS-SQL CE!
It is a verry powerfull but complex SQL-Databaseserver and needs a diffrent form of treatment as for instance ORACLE's MySQL or the PostgreSQL Databaseserver.

Prequesites:
PS: If you just want to check out this Guide for Evaluation only you can download a official and legal Windows 10 Enterprise
Evaluation copy from Microsoft which will run up to the next 90 Days (you can rearm it 6.x times so you can extent the Evaluationperiod upto max 3.x Years) if you dont have a Windows DVD or ISO at Hand. Just download the ISO if you need it and burn it to a DVD so we can use it as primary installmedia.

Windows 10 64-Bit Evaluation Edition ISO download
https://www.microsoft.com/en-us/evalcen ... nterprise

Microsoft SQL-Server Express 2017 64-Bit
https://www.microsoft.com/en-us/sql-ser ... ns-express

hMailServer 64-Bit Version (hMailServer-5.6.7-B2426-x64.exe)
https://github.com/Dravion/hmailserver/releases

Lets begin
We assume you have a fresh installed Windows 10 or Windows Server 2016 Operating System we can work with.Its not important which Edition of Win10 or Windows Server 2016 you have installed, as long as it is 64-Bit, activated or not. All below steps work with the limited Home or full blown
Enterprise or Datacenter and LTSB Verions of Windows.

#First, we should disable Win10 Update, because we dont need unplanned interruptions and Admin have other Ideas regarding Updatecycles
1) Open a Windows Command prompt as Admin and type in:
2) sc config "wuauserv" start=disabled & sc stop "wuauserv" and press ENTER
(for re-enabling Windows Update, just do the opposite.Type in: sc config "wuauserv" start=enable & sc start "wuauserv" and press ENTER)

#Install by hMailServer 5.x required legacy .NET-Framework Legacy Components (Windows Installmedia is expected in Drive D:\)
1) Open a Windows Command prompt as Admin and type in the following lines and hit ENTER
2) DISM /online /enable-feature /featurename:netfx3 /all /source:d:\sources\sxs

Stay a while in Windows Admin Command prompt, because we have to do a few things more

#Setup a static IPv4 Address (replace it with your own Local Network specific ipaddess)
netsh interface ip set address name="Ethernet" source=static addr=220.240.130.95 mask=255.255.255.0 gateway=220.240.130.1 gwmetric=1

#Setup a DNS-Server (replace the DNS-Server IP with your own DNS-Server IP)
netsh interface ipv4 add dns "Ethernet" 220.240.130.2

#Firewall settings - Type in any command starting with "netsh" and hit ENTER
*SMTP-Server to SMTP-Server outside World communication (Sent and Receive Emails
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

*SMTP E-Mail-Client access - (for sending mails from Outlook, Thunderbird, ect.)
netsh advfirewall firewall add rule name="Submissopm" dir=in action=allow protocol=TCP localport=587
netsh advfirewall firewall add rule name="Submission" dir=out action=allow protocol=TCP localport=587

*SMTP E-Mail-Program Access - (Sending part for Emails from Outlook, Thunderbird, ect.)
netsh advfirewall firewall add rule name="Submissopm" dir=in action=allow protocol=TCP localport=587
netsh advfirewall firewall add rule name="Submission" dir=out action=allow protocol=TCP localport=587

*IMAP E-Mail-Client access - (Receiving part of Emails for Outlook, Thunderbird, ect.)
netsh advfirewall firewall add rule name="IMAP" dir=in action=allow protocol=TCP localport=143
netsh advfirewall firewall add rule name="IMAP" dir=out action=allow protocol=TCP localport=143

Installation of Microsoft SQL-Server Express 2017 on Windows 10 or Windows Server 2016
In this scenario we assume your Windows Installation is new and no previous hMailServer and/or MS-SQL Server Installation was installed before.
Its possible to upgrade from SQL-Server 2014 to 2017 but this is not part of this Guide.

01) Goto your Download Folder and run SQLServer2017-SSEI-Expr.exe (you should have allready downloaded it)
02) Run the installer but DONT click "Basic" because it has bugs, instead choose Custom and go ahead
03) In the Inputfield MEDIA Location change it to your needs or leave it as it and go ahead by clicking"Install"
04) If the black Windowed Installer is finished, wait until the Window "SQL-Server Install Center" is showing up
05) Select the Option "New SQL Server stand-aline installation or add features to an existing installation" and accept License terms and click "Next"
06) If you didnt enabled "Use Microsoft Update to check for Updates", ignore the Error in Next window by just clicking Next
07) In the Install Rules Window ignore the Warning "Windows Firewall", because we dont intent to use SQLServer via TCP/IP
08) In the Feature Selection Window uncheck Machinelearning Stuff like "R" and "Python" and clock next
09) In the Instance Configuration Dialog select Named Instance (Default is SQLExpress, leave it as) and click Next
10) In Database Engine Configuration click Mixed Mode and type in a Password for SA User (we will use "secret" as password for now) - click next
11) Click the "Close" button if this step was successfull or repeat the abowe steps until they do.
12) Restart your Win 10 System to make sure the required System variables for SQL-Server are working correctly.

#SQL-Server 2017 Postinstall Windows Command Prompt steps (not necessary if you run with Windows authentication)
1) Open a Non-Admin Windows Command prompt and type in: sqlcmd -S LOCALHOST\SQLEXPRESS -U sa -P secret and press ENTER
2) Type in: CREATE LOGIN hmaildblogin WITH PASSWORD = 'secret' and hit ENTER type in GO and hit ENTER again
3) Type in: CREATE USER hmaildbusr FOR LOGIN hmaildblogin and hit ENTER type in GO and hit ENTER again
4) Tyoe in: GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE TO hmaildbusr and hit ENTER type in GO and hit ENTER again
6) Type in: GRANT CREATE ANY DATABASE TO hmaildblogin and hit ENTER type in GO and hit ENTER again
7) Thats it. Leave te SQLCMD Prompt by typing quit and hit ENTER and type in EXIT to close the Command Window.

#Installing hMailServer5.x 64-Bit for SQL-Server 2017
01) Open a Browser Window and navigate to https://github.com/Dravion/hmailserver/releases
02) Download: hMailServer-5.6.7-B2426-x64.exe goto your Download Folder and start it by right clicking "Run as administrator"
03) Accept the License agreement and click unti the "Select database server type" Window shows up, clich "Use external engine..." click Next
04) Click Next until the hMailServer Security Window shows up and setup a Admin Password (this is not the same as your DB Password!)
05) In hMailServer Database Setup Step 2 of 7, click "Create a new hMailserver database" and click Next
06) In hMailServer Database Setup Step 3 of 7, click "Microsoft SQL-Server" and click Next
07) In hMailServer Database Setup Step 4 of 7 do the following changes:
*In the inputfield: Database server address - type in: LOCALHOST\SQLEXPRESS
*In the Database name inputfiled type in: hmailserver
*Click "Use server authentication"
*Type in Username = hmaildblogin and Password = secret (or your own DB-Password you created at the SQLCMD Command prompt session)
08) Click Next and select SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS) from the Service dropdown list and click Next and Next again
09) If everything works you should see the Completed Window Step 7 of 7 - Click Close to finish the hMailServer Setup.

Thats all
Now your hMailServer 64-Bit Installation should be ready to rock, running on top of your SQL-Server 2017 Express 64-Bit Edition.
Your hMailServer can now access 8 Terrabyte of RAM. SQL Server Express 2017 has a Limit for 2 GBytes Bufferpool Memory (but can access
more RAM in general) and has a Limit of 10 GBytes per single Database on your Computers Harddrive.If you need more SQL-Database power
you need to buy SQL-Server License which fits your need. All above steps in this Guide will work for the Standard, Enterprise or even Datacenter Version of SQL-Server 2017. You can take a look at the official Microsoft Store to find out more about License stuff ect at
https://www.microsoft.com/en-us/p/sql-s ... tion&rtc=1
hmssql.png

Post Reply