Install EasyESP

Prerequisites

To follow this tutorial, you must first perform these requirements:

Then follow this five simple steps:


1. Install EasyESP

 

 

Copy the following script ( click on the small image that appears at the top right of script ) and paste it in the ‘area to be used once only’ below.
Between the quotation marks change  The_URL_of_the_EasyESP_script  with the ‘EasyESP script‘ URL received via email.
Then select, copy, ‘Right Click‘ on PuTTY window and hit  ⤶ Enter  to install EasyESP on your server.
When request copy your License Key received via email, ‘Right Click‘ to paste ( here you can’t see anything ) and hit  ⤶ Enter .
Then hit  y  to continue and hit  ⤶ Enter .
When the script has finished the installation, the last line looks like this:  EasyESP was successfully installed. 

wget -q --restrict-file-names=unix "The_URL_of_the_EasyESP_script" -O easyesp.sh.x && cd && chmod +x easyesp.sh.x && ./easyesp.sh.x

  area to be used once only:


                                                                                            * in this area the text will be deleted if you refresh this page !

 
Generate RSA ssh public/private key pair.
Run the following command.
You will see output that ask to enter file in which to save the key. By default, the file name ‘id_rsa’. Hit  ⤶ Enter  to accept this file name and path.
Next, leave the passphrase blank hit  ⤶ Enter  and again  ⤶ Enter .

ssh-keygen -t rsa

 
Create a TLS encryption key and certificate.
Run the following command line.
You will be asked for several pieces of information. Enter whatever you like. The only important field is the ‘Common Name’ that must contain the FQDN Server Name. Like this:

Country Name (2 letter code) [AU]:US                                     Hit  ⤶ Enter 
State or Province Name (full name) [Some-State]:State                       Hit  ⤶ Enter 
Locality Name (eg, city) []:Locality                                                                       Hit  ⤶ Enter 
Organization Name (eg, company) [Internet Widgits Pty Ltd]:YourDomain                         Hit  ⤶ Enter 
Organizational Unit Name (eg, section) []:YourDomain                                                 Hit  ⤶ Enter 
Common Name (e.g. server FQDN or YOUR name) []:alter.withyourdomain.com               Hit  ⤶ Enter 
Email Address []:postmaster@withyourdomain.com                                                            Hit  ⤶ Enter 

openssl req -newkey rsa:4096 -nodes -sha512 -x509 -days 3650 -nodes -out /etc/ssl/certs/mailserver.pem -keyout /etc/ssl/private/mailserver.pem

 
Configure your server running:

./conf.sh.x


2. Setup DNS records in Digital Ocean

 

 

then enter your domain name and click ‘Add Domain’. ( ex: withyourdomain.com )

Resume using PuTTy and run the following script:

cat /dns.cfg

The result looks like this:

Select all output result and paste in the ‘area to be used once only’ below.
Now select the long string after the  p=  copy and paste to the line of  mail._domainkey  in place of:
your-string-in-a-single-line in the ‘area to be used once only’ below.

  area to be used once only:


                                                                                            * in this area the text will be deleted if you refresh this page !

You can copy all records now and save them to the text file.
Thus, it also checks that the value of  p=  is a single line. ( no ‘Word Wrap’ selected in ‘Format’ on your ‘Notepad’ )

At this point go back to Digital Ocean, click on your domain name and setup DNS records.

 

 

Start everything by running:

./start.sh.x


3. Create SSL certificates with Let’s Encrypt on your server  

 

 

Think of an email address that you configure later using your domain name and write it in the ‘area to be used once only’ below. ( ex: alter@withyourdomain.com )

Copy and paste the following script in the ‘area to be used once only’ below.
Change  alter.withyourdomain.com  with your, then run it.

certbot-auto --apache -d alter.withyourdomain.com -d www.alter.withyourdomain.com

When request press  y  and hit  ⤶ Enter  to continue.
When prompted copy the email address that you have previously chosen, then ‘Right Click‘ to paste and
hit  ⤶ Enter .
When request press  a  and hit  ⤶ Enter  to Agree, then  y  ( if requested ) and  ⤶ Enter  to receive notifications.
Finally press  2  and hit  ⤶ Enter  to Redirect.

  area to be used once only:


                                                                                            * in this area the text will be deleted if you refresh this page !

Certbot can be configured to renew your SSL certificates automatically before they expire after every 90 days.

Open the crontab file running this: (if request press  2  to choose ‘nano’ as editor and hit  ⤶ Enter )

sudo crontab -e

This will create a new cron job that will execute the letsencrypt-auto renew command every Monday at 2:30 am.
Go to the bottom of the opened file using ‘down arrow’  ▼ .
Copy this line, then ‘Right Click‘ to paste it.
Save and exit: press  Ctrl  +  X  to save, then press  y  to confirm and hit  ⤶ Enter  to exit.

30 2 * * 1 /usr/local/sbin/certbot-auto renew >> /var/log/le-renew.log

Configure by running:

./letsconf.sh.x


4. Create a root password for MySQL

 

 

Generate a new password to be used for the administrative access to MySQL database with the pwgen utility. It helps you create secure passwords.
Run the following script, then select and save the password on a text file.

pwgen -s 20 1

Copy this script and paste it on the ‘area to be used once only’ below to change twice  your_db_password  and once  alter.withyourdomain.com  with yours, select all, copy and run.

mysql
use mysql;
update user set password=PASSWORD('your_db_password') where User='root';
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'root'@'alter.withyourdomain.com' IDENTIFIED BY 'your_db_password';
FLUSH PRIVILEGES;
exit
sudo service mysql restart
apt-get update

  area to be used once only:


                                                                                            * in this area the text will be deleted if you refresh this page !


5. Create a first email account

 

 

Create a password for the email user ( ex: 4y77d3f453re350261 ) and save it to the text file.

Then run the following script to create a secure hash of the simple password.
When the ‘password‘ is requested, copy it, ‘Right Click‘ in PuTTy to paste and hit  ⤶ Enter , again ‘Right Click‘ and hit  ⤶ Enter  to confirm.

dovecot pw -s SHA256-CRYPT

Select the long cryptic password and paste it in ‘area to be used once only’ below.

Run the following command to login in ‘mysql’ database.
When prompt, copy the database password ( your_db_password ), ‘Right Click‘ in PuTTy to paste and hit  ⤶ Enter .

mysql -uroot -p

Copy the following script, paste it in the ‘area to be used once only’ below and change twice  alter , twice  info  (alias), five times  withyourdomain.com , and once  {SHA256-CRYPT}$5$E.51k2o.mXG.......Z4rHZ0  with yours.
Then run it.

use mysql;
REPLACE INTO `mailserver`.`virtual_domains` ( `id` , `name` ) VALUES ( '1', 'withyourdomain.com' );
REPLACE INTO `mailserver`.`virtual_users` ( `id` , `domain_id` , `password` , `email` )
VALUES ('1', '1', '{SHA256-CRYPT}$5$E.51k2o.mXG.......Z4rHZ0' , 'alter@withyourdomain.com');
REPLACE INTO `mailserver`.`virtual_aliases` (`id`,`domain_id`,`source`,`destination`)
VALUES ('1', '1', 'info@withyourdomain.com', 'alter@withyourdomain.com');
exit
service apache2 reload
service dovecot restart
systemctl restart postfix
service mysql restart
apt-get update
newaliases
postmap -q info@withyourdomain.com mysql:/etc/postfix/mysql-virtual-alias-maps.cf
newaliases

  area to be used once only:


                                                                                            * in this area the text will be deleted if you refresh this page !

 
Finally you have your own SMTP Mail Server provider for sending unlimited emails via these SMTP settings:

SMTP settings
Host: alter.withyourdomain.com
Port:   25           587           465
SSL/TLS:   TLS          TLS           SSL
Username: alter@withyourdomain.com
Password: your password created in step 5

 
Add a second user email account and alias to your domain by editing and running the following script:
(create first a secure hash of a new password using  dovecot pw -s SHA256-CRYPT  command and login database with  mysql -uroot -p  and ‘your_db_password’.)

REPLACE INTO `mailserver`.`virtual_users` ( `id` , `domain_id` , `password` , `email` )
VALUES ('2', '1', '{SHA256-CRYPT}$5$UdYiacPX70E.......epr7RD' , 'bounce@withyourdomain.com');
REPLACE INTO `mailserver`.`virtual_aliases` (`id`,`domain_id`,`source`,`destination`)
VALUES ('2', '1', 'list@withyourdomain.com', 'bounce@withyourdomain.com');
exit
service mysql restart
apt-get update

 
To add more email accounts and aliases to your domain increase the VALUES  ('2',  to assign a different ‘id’ to new users.


 

Access web interfaces via a web browser

 

 

►    Now you can access the Phpmyadmin web interface via  https://alter.withyourdomain.com/phpmyadmin/
Then enter root as user and the password you chose in in step 4.
( your_db_password )

►    Access the Roundcube webmail user interface via  https://alter.withyourdomain.com/
Login with the credentials you created in step 5.
( ex: Username: alter@withyourdomain.com and Password: 4y77d3f453re350261 )

 


What’s next?

Based on what you need to do, you can choose every one of these tutorials:

Email List Verifier

Install Sendy

Install WordPress

Deactivate EasyESP License Key