Installing Mail SMTP server on Ubuntu

In this post I'll describe, how to install SMTP server.
Install mailutils:
sudo apt-get install mailutils
Select   Internet Site. Change  System mail name, if needed. In my case it will be  forum.artfun.pw.
After installation, try to send test email to your Gmail box with command
echo "This is the body of the email" | mail -s "This is the subject line" [email protected]
It should be received Gmail like Spam - check your Spam folder and you will see email "This is the subject line". It will be labeled as " security: No encryption Learn more".
Let's setup encryption.
Install letsencrypt to generate certificates:
sudo apt install letsencrypt
Once the install is finished, you can run the certificate process with the easy command below. Replace the forum.artfun.pw with your domain name.
sudo letsencrypt certonly --standalone -d forum.artfun.pw
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf. You must agree
in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A

-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for forum.artfun.pw
Waiting for verification...
Cleaning up challenges


IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/forum.artfun.pw/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/forum.artfun.pw/privkey.pem
   Your cert will expire on 2018-01-05. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Configure Postfix to use your certificates:
sudo postconf -e 'smtpd_tls_cert_file = /etc/letsencrypt/live/forum.artfun.pw/fullchain.pem'
sudo postconf -e 'smtpd_tls_key_file = /etc/letsencrypt/live/forum.artfun.pw/privkey.pem'
Then configure Postfix to provide TLS encryption for both incoming and outgoing mail.
sudo postconf -e 'smtp_tls_security_level = may'
sudo postconf -e 'smtpd_tls_security_level = may'
sudo postconf -e 'smtp_tls_note_starttls_offer = yes'
sudo postconf -e 'smtpd_tls_loglevel = 1'
sudo postconf -e 'smtpd_tls_received_header = yes'
sudo systemctl restart postfix
After all of this ask your hosting provider to add Reverse DNS, by providing them your hosting FQDN and IP. For example:
Please, add Reverse DNS for my servers IP 185.22.155.111 and FQDN forum.artfun.pw.
After your hosting provider will make all needed changes for that, you can check it with  https://mxtoolbox.com/ReverseLookup.aspx or with  https://www.whatismyip.com/reverse-dns-lookup/ or with any other tools, that you Google by phrase  reverse dns lookup.