,

Simplest Way to Configure Postal & Create SMTP + Install SSL

postal-create-SMTP-add-domain-SSL

In the article Install Postal SMTP server on Ubuntu 18.04, I already have discussed steps to install Postal Successfully. Now in this article, I will tell you the commands and steps required to configure Postal, create organizations, add domains, create SMTP etc. Apart from that, I will also discuss the steps required to install SSL certificate. Now, here note that SSL for click tracking is handled by Postal and therefore you don’t have to do anything for that. It’s only the SSL for web ui and SMTP that we are going to install and configure.

Creating First SMTP on postal

First of all login to your Postal and then create your first organization.

postal-dashboard

Next create your First SMTP server

build-smtp-server-postal

On next screen fill the details

build-smtp-server-postal

After you have successfully built the server, it’s time to add a domain.

postal-add-domain

Next, you will be given set of DNS records to create. So, just create them.

Creating DNS records for Postal

Their is very nice article already written by developers of Postal to create DNS records. But if you follow along, you might get lost and miss mail-tester 10/10 score.

Create the following records

NameTypeValue
mailA1.2.3.4
rp.mailA1.2.3.4
track.mailA1.2.3.4
psrpCNAMErp.mail.inguide.in
@MX10; mail.inguide.in
routes.mailMX10; mail.inguide.in
rp.mailMX10; mail.inguide.in
@TXTv=spf1 a mx include:spf.mail.example.com ~all
rp.mailTXTv=spf1 a mx include:spf.mail.example.com ~all
spf.mailTXTv=spf1 ip4:1.2.3.4 ~all
postal-a1b2c3._domainkeyTXTv=DKIM1; t=s; h=sha256; p=MIGfMA0GC…;
_dmarcTXTv=DMARC1; p=reject; sp=reject; rua=mailto:postmaster@example.com

Creating SMTP server

Go to credentials tab and add credentials

postal-create-credentials

After you have created credentials, key will automatically appear which is none other then your SMTP password in case you have selected SMTP from drop down list. Otherwise, it can be used as API key.

Now you can do the testing with several email marketing tools available.

Installing Free SSL on Postal

First to all get the certbot

apt install certbot

To get the SSL certificate execute the following command.

certbot certonly --webroot --webroot-path /opt/postal/app/public --domains mail.yourdomain.com

This will procure SSL certificate and store it on your server. Also, Certbot will tell you where the certificate is located. Subsequently, you have to specify the certificate location inside the nginx configuration and postal.yml

Open nginx config file

nano /etc/nginx/sites-available/default

Next edit the already present private certificate to add the following lines to it.

ssl_certificate     /etc/letsencrypt/live/mail.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.yourdomain.com/privkey.pem;

After that open the Postal config file postal.yml

nano /opt/postal/config/postal.yml

Then add the following line to it

smtp_server:
  tls_enabled: true
  tls_certificate_path: /etc/letsencrypt/live/postal.yourorganisation.com/fullchain.pem
  tls_private_key_path: /etc/letsencrypt/live/postal.yourorganisation.com/privkey.pem

Next restart the Nginx to reload the new certificate into the browser.

sudo systemctl reload nginx

Now go to the browser and reload the webpage.

How to Renew SSL Certificate?

As long as you got the certificate from Lets encrypt, Certbot will automatically renew the certificates so you don’t have to worry about replacing them yourself.

Video

Conclusion

Installing and configuring Postal for beginners could be daunting task. But with the help of this and previous article along with video guide, I hope you would be able to install successfully.

18 replies
  1. TAOUFIK EL BOUAIDI
    TAOUFIK EL BOUAIDI says:

    Hello sir, thanks for your video that explains how to create Postal SMTP!

    i followed ur Video and everything went Just great till the last part! when i do test sending email
    it failed saying ” soft fail “

    Reply
  2. Faruk Rahaman
    Faruk Rahaman says:

    SSL not install
    When i run this command certbot certonly –webroot –webroot-path /opt/postal/app/public –domains mail.mydomain.com then the message show “/opt/postal/app/public does not exist or is not a directory”
    I create a directory /opt/postal/app/public this path..after I run the command which i mention
    above the command the message showing below.
    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 our work
    encrypting the web, EFF news, campaigns, and ways to support digital freedom.
    – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
    (Y)es/(N)o: Y
    Obtaining a new certificate
    Performing the following challenges:
    http-01 challenge for postal.mydomain.org
    Using the webroot path /opt/postal/app/public for all unmatched domains.
    Waiting for verification…
    Challenge failed for domain postal.mydomain.org
    http-01 challenge for postal.mydomain.org
    Cleaning up challenges
    Some challenges have failed.

    IMPORTANT NOTES:
    – The following errors were reported by the server:

    Domain: postal.mydomain.org
    Type: unauthorized
    Detail: Invalid response from
    https://postal.mydomain.org/.well-known/acme-challenge/wTVdxm0GyfEiUEr XVjsKdTLrVg1esDxGa5NR2UMRs0Y
    [62.38.62.32]: 502

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A/AAAA record(s) for that domain
    contain(s) the right IP address.
    – Your account credentials have been saved in your Certbot
    configuration directory at /etc/letsencrypt. You should make a
    secure backup of this folder now. This configuration directory will
    also contain certificates and private keys obtained by Certbot so
    making regular backups of this folder is ideal.

    please help me.

    Reply
  3. othmane
    othmane says:

    hello i can’t sent messages they still in pending, and i have this error
    postal_cron_1 /docker-entrypoint.sh post … Up
    postal_requeuer_1 /docker-entrypoint.sh post … Exit 1
    postal_smtp_1 /docker-entrypoint.sh post … Up
    postal_web_1 /docker-entrypoint.sh post … Up
    postal_worker_1 /docker-entrypoint.sh post … Exit 1
    what should i do please ?

    Reply
  4. zakaria
    zakaria says:

    Othmane : that exit 1 if you past to google you will know what mean that ,, so just in terminal put postal stop , then postal start , then postal status ,,,, do that fast and you will see all up ,,,,,,but if you use again postal status after 1 minute you will see exit 1 because the docker do that by default when nothing in their containers ,,,,,,,,,
    my problem now why the test not work in server and how I uninstall or delete the kaddy for I reinstall again because not work

    Reply
  5. Hendra Hendartok
    Hendra Hendartok says:

    I tried install ssl with command

    #certbot certonly –webroot –webroot-path /opt/postal/app/public –domains mail.obelixnorp.net

    But result be fail like this

    /opt/postal/app/public does not exist or is not a directory

    Can u expland?

    Reply
  6. spams
    spams says:

    make an article on IP rotation, how to use more than on IP to send mails, and also there’s tracking available on postal as well, do that too

    Reply
  7. Hetich
    Hetich says:

    Hi Dheeraj,

    Please share the link to the next part where you have made the videos on Postal IP rotation, and how to configure mailwizz/mautic with Postal Smtp.

    I have searched on your Youtube channel, it is not available there.

    Please share the link here

    Reply
  8. mainuddin
    mainuddin says:

    “certbot certonly –webroot –webroot-path /opt/postal/app/public –domains mail.get4free.site
    /opt/postal/app/public does not exist or is not a directory
    Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/tmp_t9oel0l/log or re-run Certbot with -v for more details.”

    How To Fix This?

    Reply
  9. imad
    imad says:

    hello after I set up my vps smtp in postal & wanted to relate it with acellemail I got this message
    Please help

    Something went wrong! Please check your entry and try again.

    Connection could not be established with host mail.amazingfabrica.us :stream_socket_client(): unable to connect to mail.amazingfabrica.us:25 (Connection refused)

    Reply
  10. Yaja
    Yaja says:

    WARNING No TXT records were returned for postal-jMZ2si._domainkey.yourdomain.com

    even after entering the valid Dkim record it says this please help me out with this

    Reply

Trackbacks & Pingbacks

  1. […] Simplest Way to Configure Postal & Create SMTP + Install SSL Build SMTP server with iRedMail on Ubuntu 20.04 in Simple Steps 11 replies […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *