The Ultimate MailWizz Configuration No One Will Tell You

 In Case Study, Linux Server Case Studies, Managed Server Cases Studies

Email Marketing is one of the most popular segment of the digital marketing industries, if not the most popular. There are many solutions out there each coming with their respective set ups.

The MailWizz configuration can be a daunting task. Not only the mail server configuration is complicated but one single mis-step in the installation could lead to disastrous results with the IP reputation at risk.

You’ll find many paid guides online covering a slight proportion of this use case. Don’t look further, you have found a gem! Just scroll through and you’ll see.

Through this case study, you’ll learn not only about the installation of MailWizz but about its RIGHT installation. You’ll learn how to set up your mail server, optimize the performances so you can reach a great mailing rate level, and also get a working MailWizz installation. This guide is by design highly thorough and will walk you through all the steps in details.

For this use case we warmly recommend at least a Linux VPS level 4 with cPanel or a Managed VPS Level 4.

If you are a Managed VPS User you may jump directly to the MailWizz Configuration part as all the installations steps would be done for you upon delivery without even the need to even mention it.

Configuring the Server & cPanel

First, you would need to set your hostname to be as follows ‘server.domain.com’. You may purchase a dedicated domain for this project by simply going to the domain registration interface. You may predefine the hostname of your VPS by setting the server.domain.com directly from the order form.

If you already have a server and you need to change your hostname, you would need to either change it from your client area or login to SSH and type the following command:

hostnamectl set-hostname server.domain.com

The Hostname plays a huge factor in the mailing set up and it is important to have a hostname that matches the mailing domain.

Once you have changed your hostname, you would be able to install cPanel to do so you would need to run the following command :

wget http://layer1.cpanel.net/cpanel-universal-install.sea && chmod 700 ./cpanel-universal-install.sea && ./cpanel-universal-install.sea

 

Once the installer is completed, you may access cPanel by accessing the following URL : https://ip:2087. You may approve any warning you would have as there isn’t any SSL installed yet. To approve the self signed SSL in your browser, you may refer to this guide.

It is important to keep the https:// part of the URL if the DNS of the domain isn’t yet set up.

For the Wizard, you would just need to set it as following :

Email : admin@domain.com

Namservers :

  • ns1.domain.com
  • ns2.domain.com

You may refer to our knowledgebase to register your private name servers before going any further so the domain will be already fully ready to operate.

Once logged in, the first step is to create a cPanel account for your domain. You may read the following guide if you aren’t sure on how to install it.

From there, your server is now configured and the domain points to your server. A great achievement already but let’s continue.

Tweaking Performances

A. PHP Optimisation

Performances will play a huge factor for your mailing campaigns and if you purchased the VPS through us the hardware would be outstanding already but it is now time to magnify it through several tweaks. This is THE guide so let’s not leave anything behind and be thorough.

Download our Apache Optimisation Profile hs-ea4perf-tuning-jun20.json. Unzip the file on your computer.

In WHM sidebar click on EasyApache 4 and click on Upload a Profile, select the uncompressed .json file. and click upload.

 

Once the WHM page is refreshed, you’ll be able to click on the Managed-VPS profile and click on Provision which is the default PHP settings we use for our Managed Server users as of June 2020. It includes some important security tweaks, performances enhancements, and PHP most used features.

Then, It will prompt you to a list of PHP extension installations recapitulative on which you would need to click on Provision. You may take a cup of coffee while Apache and all the PHP settings are installed.

Once the Apache / PHP recompilation is completed, you may go to the MultiPHP Manager setting page. In this page, you’ll need to Click on Turn Of System PHP-FPM Status, select the PHP version of your cPanel account to PHP 7.3 and make sure PHP-FPM is set as Off for the account.

While PHP-FPM can be a great addition in Shared environment, it is the case only if configured properly. In the present situation, it doesn’t bring any value and requires more complicated tweaks to achieve a decent performances level. So let’s disable it.

Let’s now change the PHP-Handler which is how the PHP is read and let’s spice it up a little. Click on the PHP Handlers tab and for the PHP 7.3 version select the PHP FCGI which stands for Fast-CGI.

In WHM’s sidebar, click on MultiPHP Ini Editor, and select the the VPS version ea-php73 and set the values as follow in the screenshot and click on save.

 

If you want to go further with the PHP configuration, you may install and enable a Redis Memory Cache. It would help greatly to increase the mailing rate. To install a Redis Cache you may refer to this guide.

B. Apache Configuration

Then click on Apache Configuration  in the sidebar and Global Configuration in the options page. You will need to increase both the Server Limit and the Max Request Workers to a higher value and then click on Save at the bottom of the page.

It will prompt you with a summary of the changes and you will need to click on Rebuild Configuration and Restart Apache

This would allow you to sustain a greater traffic load in case you are hosting your landing pages on the server.

C. MySQL Optimisation

MySQL Optimisation plays a huge role into your MailWizz Server behaviour. As a matter of fact, the System would heavily rely on the database to feed the PHP processes with the required datasets. Therefore, it

This part presuppose that you opted for a Unmanaged VPS Level 4 at least as the optimisation is resources sensitive. Any attempt to perform this step on any server with a lower configuration may break the proper behaviour of your running websites. Perform this step with caution.

Open a SSH command prompt and run the following commands. The commands includes a backup of the previous configuration

mv /etc/my.cnf /etc/my.cnf
nano /etc/my.cnf

The later command would open a text editor in which you would need to paste the following content

[mysql]
# CLIENT #
port                           = 3306
socket                         = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
user                           = mysql
default-storage-engine         = InnoDB
socket                         = /var/lib/mysql/mysql.sock
pid-file                       = /var/run/mysqld/mysqld.pid
# MyISAM #
# key-buffer-size                = 32M
# myisam-recover                 = FORCE,BACKUP
# SAFETY #
max-allowed-packet             = 16M
max-connect-errors             = 1000000
skip-name-resolve
sql-mode                       = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
sysdate-is-now                 = 1
innodb-strict-mode             = 1
# DATA STORAGE #
datadir                        = /var/lib/mysql
# SERVER ID #
server-id                      = 754493

# BINARY LOGGING #
log-bin
# CACHES AND LIMITS #
max-connections                = 500
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 1024
table-open-cache               = 2048
# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 768M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 2304M
# LOGGING #
log-error                      = /var/log/mysqld.log
slow-query-log                 = 1
slow-query-log-file            = /var/log/mysqld-slow.log
log-queries-not-using-indexes  = OFF
long_query_time                = 30
# INI AND SQL SECURITY #
local-infile                   = 0
sql_mode                       = ""
[mysqldump]
max-allowed-packet             = 16M

To exist and save type “CTRL + X” and Y. which would close the file.

Finally restart the MySQL server by typing :

systemctl restart mysqld

Optimising Mail Server Deliveries

Throughout this part, you’ll learn how to maximise the delivery of your server by tweaking its default behaviour and bring a set of powerful tweaks. The purpose is to increase the inboxing rate of your campaigns. We will see how to set the PTR Records (rDNS), set DKIM / SPF, enable DMARC  and fix the SMTP Banners of your mail server.

A. Set the rDNS, SPF / DKIM

This part assume you have the VPS with us as the steps may differ according to providers or may not be available. It is a crucial part of personalising the mail server as ISP (Internet Services Providers) do rely on the PTR records to corroborate the sender identity during the SMTP transaction.

In order to set the rDNS, you would need to login to your client area and click on ‘My Services’. Once, in the My Services page, you would need to select your VPS.

Once, on the service’s page, you would simply need to click on the rDNS tab and set your rDNS to be server.domain.com and click the update button.

 

 

For the SPF and DKIM, if you have created your cPanel account properly, they both should be enabled and functioning already. For advanced users, you may edit the SPF records and add your other delivery servers in the SPF DNS settings.

To verify or edit the SPF settings, you may log in to WHM and click on Edit DNS Zone in sidebar, select your domain and then review the two lines including spf1 and DKIM1.

To edit the SPF record and add a new delivery sender for your domain you may add the following for the IP that you would like to authorise to send on your domain’s behalf.

"v=spf1 +a +mx +ip4:1.1.1.1 +ip4:1.1.1.2 +ip4:1.1.1.3 ~all"

B. Set DMARC Records

The DMARC records is an important protection to set for you domain which adds a protection against Domain Spoofing practices. It allows to declare a policy on how emails failing the DMARC records (AKA spoofed ones) should be handled by the recipient’s server.

The ISP would check the DNS records and notice that the originating IP of the email isn’t declared. Therefore, the ISP would then check the DMARC rules to see how to handle it and follow through. Not only, it is a layer of protection but it is also a trust signal for email deliveries.

To easily set up the DMARC DNS records, go to this URL: https://dmarcguide.globalcyberalliance.org/

Type your domain name in the yourdomain.com prompt field. On the next step, click on DMARC and then click on Next.

You should see a green tick for SPF / DKIM. Given the fact that the tutorial isn’t using an actual domain, it returns as false here.

 

At the next stage, click on Next. Then, in the dropdown select Reject and click on Next.

Then, input your email admin@domain.com, that you used for your server configuration.

Same goes for the Forensic Report email address. Set up the email admin@domain.com

Also, set Reject for DMARC Policy Subdomain.

At the Next Stage, you would need to change the following values:

 

  1. Alignement mode for DKIM -> s(Strict)
  2. Alignement mode for SPF -> s(Strict)

And then click on Finish as shown in the screenshot below.

 

At the recapitulative stage, the website will return your record. In WHM go to Edit DNS Zone as shown the step to verify the DKIM / SPF records.

From the website’s provided DMARC output, extract this part:

_dmarc.mailwizz.freehst.com.

and then the part in quotes :

"v=DMARC1; p=reject; rua=mailto:admin@domain.com; ruf=mailto:admin@domain.com; sp=reject; aspf=s; adkim=s; ri=86400"

In WHM DNS zone editor for your domain, set it exactly as follows and click on save:

 

That’s it! Your DMARC records are now set.

C. Fixing SMTP Banners

SMTP Banners are shown during the SMTP transaction. Your mail server will announce itself to the recipient’s ISP when you send an email. The SMTP banner should match the hostname which is also a trust signal which would help you greatly.

To proceed with the fix, go in WHM and search in the sidebar ‘Exim Configuration Manager’

Click on the Domains and IPs tab and activate the following options:

  • Send Mail from the account’s IP address -> Off
  • Use the reverse DNS entry for the mail HELO  EHLO if available -> Off
  • Reference /etc/mailhelo for custom outgoing SMTP HELO -> On
  • Reference /etc/mailips for custom IP on outgoing SMTP connections -> On

Click on save which would prompt you the confirmation that Exim has been restarted.

Open a SSH Command prompt and run these two commands and replace the value server.domain.com and 8.8.8.8 by your own server’s value.

touch /etc/mailhelo
echo "*: server.domain.com" > /etc/mailhelo
touch /etc/mail_reverse_dns
echo "8.8.8.8: server.domain.com" > /etc/mail_reverse_dns

Go back on the Exim Configuration Manager and click on the Advanced Editor Tab:

In the advanced option list, use your browser’s search capacity (CTRL + F) to look for the pattern “smtp_banner”

Replace the content that follows:

"${primary_hostname} ESMTP Exim ${version_number}  \#${compile_number} ${tod_full} \n   We do not authorize the use of this system to transport unsolicited, \n   and/or bulk e-mail."

by

"${smtp_active_hostname} ESMTP Exim ${version_number} \#${compile_number} ${tod_full} \n We do not authorize the use of this system to transport unsolicited, \n and/or bulk e-mail."

Next, scroll down from that option until you see a blue text box that states: ‘Add Additional Configuration Setting’ and click on it twice which will create two new set of options :

 

In the first option field’s dropdown type and select “smtp_active_hostname” and in the matching option field set it to :

${lookup{$interface_address}lsearch{/etc/mail_reverse_dns}{$value}{$primary_hostname}}

Then, in the second option field dropdown type and select “message_id_header_domain” and then enter:

$smtp_active_hostname

Which should look like as follows:

You may now scroll down and hit the save button.

 

Installing MailWizz

 

A. Create the MySQL Database / User

Now that the mail server is configured and optimised for delivery, let’s move onto the installation of MailWizz.

Login, to your domain’s cPanel (you may use this method). Once in cPanel, click on MySQL Database

Head to the create new database section and set your database name and click on Create Database

Then go back to the previous page and create an user by click on Add New User and choose an username and a password. The prefix will of both the database and the username will rely on your cPanel username. Store this database name, username and password somewhere.

 

Go back to the MYSQL database section and go at the bottom and in section Add User To Database select the user and the database name you just created and click on Add.

At the next step click on All Privileges and click on Make Changes.

You have now created an user which will have the required rights on the databases for MailWizz to operate.

 

B. Upload MailWizz Files

You may download the mailwizz files on your computer. You may unzip the file archive you received. Connect to the cPanel Account FTP details.

As a reminder the FTP Details are as follows:

  • Host: Server’s IP Address
  • User: cPanel Username
  • Password: cPanel Password
  • Port: 21

From the FTP client go to the public_html directory and upload all mailwizz files included in the latest folder.

Once you have uploaded your files,  your Public_html should look like this :

Of course, you may use a subdirectory of any existing domain during the upload.

 

C. Create the required Email Accounts

We are now going to create the email accounts required for MailWizz to operate properly. In your cPanel click on Email Account. and 

Then click on the create button :

You would need to create the following emails:

  • any@domain.com -> It will be the email used to send your campaign. It can be anything
  • admin@domain.com -> Server related Emails
  • returnpath@domain.com -> Bounce Related Emails
  • postmater@domain.com -> Feedback Loop / Bounces Related Emails
  • abuse@domain.com -> Complaints / Abuse Email
  • fbl@domain.com -> Feedback Loop Related Emails

You may set the storage space to unlimited and then click on Create.

Repeat the previous steps for all the emails required for MailWizz to operate properly.

Now you are finally ready to get going with MailWizz Installation process.

D. Running The MailWizz Installer

Go to the following URL and replace of course by your domain and directory if not public_html. http://www.domain.com/install

You’ll be prompted to enter your MailWizz Purchase Code (License) and to agree the Terms and Conditions.

On the next step, MailWizz will check the server requirements and make sure that it has been properly configured. You should have done it in the Tweaking Performance Section and you should see as indicated in the screenshot below and hit the next button:

In the next step MailWizz will check whether it has the required permissions to operate properly. If you followed the steps properly it should be working without you having to change the permission.

Otherwise, you would need to go to the file manager and navigate through the mentioned directories. (for instance: /home/cpanalusername/public_html/apps/common) and right click on the desired directory to select Change Permissions.

Then in the pop up you would need to enter 7 7 7 or tick all boxes.

*We highly do not recommend to change the permissions for all the directories but only for the mentioned ones. 

One the next step, you’ll be prompted to enter your MySQL Database details that you have created previously. You’ll be needed to provide the MySQL Username, the password you had chosen and also the Database Name. You may also change the Tables Prefix to any random 3 to 4 characters strings. It is a good security practice to do so. Once, done you may click on Start Importing.

You’ll then be asked to enter your MailWizz details which will be used to access the Backend later. Set a secure password and use the email admin@domain.com that you created earlier and click on Create Account.

 

E. Setting Up the CronJobs

A the next stage, you’ll be prompted to set cronjob which are required for MailWizz to automatically send emails. For this step, the easiest solution is to  open a SSH prompt and run the mentioned commands in the second code block.

su cpanelusername
cd /home/cpanelusername
crontab -l > mwcron
echo "* * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php send-campaigns >/dev/null 2>&1" >> mwcron
echo "*/2 * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php send-transactional-emails >/dev/null 2>&1" >> mwcron
echo "*/10 * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php bounce-handler >/dev/null 2>&1" >> mwcron
echo "*/20 * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php feedback-loop-handler >/dev/null 2>&1" >> mwcron
echo "*/3 * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php process-delivery-and-bounce-log >/dev/null 2>&1" >> mwcron
echo "0 * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php hourly >/dev/null 2>&1" >> mwcron
echo "0 0 * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php daily >/dev/null 2>&1" >> mwcron

*These commands are indicative only, you need to copy paste those from your MailWizz installation and your cPanel username

Then run this command which will load all the cronjob :

crontab mwcron

Or, you may access the cPanel interface and configure using the graphic interface. In order to proceed, click on Cron Jobs inside your cPanel.

 

And configure each line as and select the proper duration. For example for the cronjob :

* * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php send-campaigns >/dev/null 2>&1

It should be :


For:

*/10 * * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php bounce-handler >/dev/null 2>&1

It should be:

 

For:

0 0 * * * /opt/cpanel/ea-php73/root/usr/bin/php -q /home/mailwizzfreehst/public_html/latest/apps/console/console.php daily >/dev/null 2>&1

It will be:

Once you are done with either of the method to install the MailWizz Cronjobs, you may go to cPanel and click again on CronJob and it should look as indicated in the screenshot:

That’s it MailWizz is finally installed and it is now to finalise the configuration of MailWizz for it to be able to send emails.

 

E. MailWizz Bounce Server Configuration

Now, it is time dive into MailWizz configuration. You may go to the URL : http://www.yourdomain.com/backend/index.php. Login using the email and password you have defined in the wizard. MailWizz relies on servers in order to handle your emailing campaigns. We will therefore create the different required servers.

In MailWizz Sidebar click On Servers > Bounce Servers and click On Create New

In the next step you should fill it as follows:

  • Hostname: mail.domain.com
  • Usetname: bounce@domain.com
  • Password:  Email Password
  • Service: IMAP
  • Port: 993
  • Protocol: SSL
  • Validate SSL: Yes

It should be as follows:

 

F. MailWizz Delivery Server Configuration

Now, it is time to set a delivery server which will be used for your email campaigns.

In MailWizz Sidebar click On Servers > Delivery Servers and click On Create New Server.

You’ll be asked to choose among different deliveries server type. You will need to select SMTP

 

Here you’ll have to input the different settings of your mail Server :

 

  • Name: Anything you want
  • Hostname: domain.com
  • Username:  any@domain.com
  • Password: Email Password defined Earlier
  • Port: 465
  • Protocol: SSL
  • Timeout: Leave it at 30
  • From Email: any@domain.com
  • From Name: The name you would like to have on email campaigns
  • Probability: 100% (leave it there, if you have only one delivery server)
  • Hourly Quota: Start with 30 to begin with (increase it over time)
  • Daily Quota: Leave it at 0 as Hourly Quota would prevail
  • Pause After Send: Leave it at 0
  • Bounce Server: Select the Bounce Server you have created
  • Tracking Domain: No need to change
  • Use for: All
  • Singing Enable: Yes
  • Force FROM: Change it to Never
  • Reply-To-Email: any@domain.com
  • Force-Reply-To: Never
  • Max Connections Message: Leave it at 1

It should look like as in the screenshot

Upon saving, you’ll be asked to click on Validate your delivery server. You would just need to set an email address (it can be any email) and then click on Validate Server. It will send a verification email with a link you would need to click on. Upon clicking the verification link, your MailWizz Delivery Server will be activated

 

G. MailWizz FeedBack Loop Servers Configuration

Now it is time to create the Feedback Loop servers. Indeed, these servers will be used for every Spam report and to process them.  The ISP would automatically forward the complaints to either of these emails:

  • bounce@domain.com
  • fbl@domain.com
  • abuse@domain.com

 

You’ll therefore have to perform the steps below thrice. One for each of these emails with their associated password. The others values would remain the same.

In MailWizz Sidebar click On Servers > Feedback loop Servers and click On Create New Server.

You’ll be asked to fill these details:

  • Hostname: mail.domain.com
  • Username: abuse@domain.com
  • Password: Your Saved Email Password
  • Email: abuse@domain.com
  • Service: IMAP
  • Port: 993
  • Protocol: SSL
  • Validate SSL: Yes

It should look as follows:

You may face the need to use several Mailing List during your campaign. You would need to enable the feature by going to the MailWizz Sidebar and click on Settings > Customers. Then, among the tabs at your disposal you may select Campaigns and set the “Send to Multiple Lists” dropdown to Yes.

 

Conclusion

That’s it! You have mastered the creation from A to Z of your Mailing Server and it is ready to go while being fully optimised. Performances and delivery wise, you have crafted the ultimate MailWizz server for your digital marketing ventures. A strong tool in your arsenal!

 

DO YOU WANT US TO DO IT?

You read through it all. If you want to hire us to perform the exact whole described installation, including the MailWizz License, we can!

Click here to get started and 48 hours later, all the details would be shipped over to you and ready to mail.

 

 

Recent Posts
Comments
  • mailozz
    Reply

    Jeez!! Ty for this tuto i finally inbox gmail & hotmail

Leave a Comment

Start typing and press Enter to search