Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Mail Server
  • Search

How-To Exim+Dovecot+Vesta with SSL/TLS Let'sEncrypt

Questions regarding the Mail Server
Dovecot, Exim, RoundCube
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
danielz
Posts: 9
Joined: Sat Oct 07, 2017 6:36 pm

How-To Exim+Dovecot+Vesta with SSL/TLS Let'sEncrypt
  • Quote

Post by danielz » Wed Jun 20, 2018 7:55 pm

First: Sorry for my english, I'm BR.

Hello guys,

today I almost broken my head with this problem, the exim mail server got a big problem related for SSL/TLS certificates.
Because when you try to send mails to anyother person you can't because you got CERTIFICATE error then almost all mail servers block you.

Then I have a SOLUTION, so let's go.

First Step:
[*] You need to ADD a WEB ALIASE with the name: mail.your-domain.tld

Image

Then make sure you have * SSL Support and * Lets Encrypt Support MARKED.
Then SAVE.

Go back and click again in your-domain.tld and check if appears in ALIASES this: mail.your-domain.tld

Second Step
[*] You need create a SYMLINK of your CERTIFICATE for your domain in /usr/local/vesta/ssl directory. (you can use a differente directory if you want)
I put all my certificates in one directory to make it more simple.

To create a SYMLINK use this command:
ln -s /home/USER/conf/web/ssl.your-domain.tld.pem /usr/local/vesta/ssl/mail.your-domain.tld.pem
ln -s /home/USER/conf/web/ssl.your-domain.tld.key /usr/local/vesta/ssl/mail.your-domain.tld.key

Then set the MAIL permission or EXIM, its depend's your LINUX OS, in my case is CentOS then I have mail user.

Use this command:
chown root.mail /usr/local/vesta/ssl/mail.your-domain.tld.pem
chown root.mail /usr/local/vesta/ssl/mail.your-domain.tld.key

Now go to your EXIM.conf, probably located in /etc/exim/exim.conf and search for: tls_privatekey, then comment:
# tls_privatekey
# tls_certificate
and add:
tls_privatekey = ${if exists{/usr/local/vesta/ssl/${tls_sni}.key}{/usr/local/vesta/ssl/${tls_sni}.key}{/usr/local/vesta/ssl/your-default-vesta-certificate.key}}
tls_certificate = ${if exists{/usr/local/vesta/ssl/${tls_sni}.pem}{/usr/local/vesta/ssl/${tls_sni}.pem}{/usr/local/vesta/ssl/your-default-vesta-certificate.pem}}

Exim part DONE, let's go to DOVECOT:

First Step:
Find you DOVECOT directory, probably /etc/dovecot, then go to conf.d and edit this: 10-ssl.conf file.
Then add this config:

local_name mail.your-domain.tld {
ssl_cert = </usr/local/vesta/ssl/mail.your-domain.tld.pem
ssl_key = </usr/local/vesta/ssl/mail.your-domain.tld.key
}

Each domain you have you need an LOCAL_NAME for this.

Make sure you have this BEFORE in your 10-ssl.conf:
ssl = yes
ssl_cert = </usr/local/vesta/ssl/your-default-vesta-certificate.pem
ssl_key = </usr/local/vesta/ssl/your-default-vesta-certificate.key
The Final Step:

Make sure you restart the EXIM + DOVECOT services then test it:

openssl s_client -showcerts -connect localhost:993 or 587 (depends yours ports and server name, I used localhost)

Then you can see your Let'sEncrypt certificate in action.
For more tests go to: https://www.checktls.com/perl/live/TestReceiver.pl
And: https://www.mail-tester.com <<< to make a message test.

Look my mail-server SCORE:

Image

This is it.
If you have any problem tell me.
Hope this help a lot of people :)
Sincerely, Daniel.
Top

daniluski
Posts: 8
Joined: Sun Jul 30, 2017 10:41 pm

Re: How-To Exim+Dovecot+Vesta with SSL/TLS Let'sEncrypt
  • Quote

Post by daniluski » Wed Jul 04, 2018 7:24 pm

My friend I have the same problem.

Is this solution work in multiple domains? Cause I was reading it and now I have doubts if it only will work in one domain or will work in other domain that will be host together.

Example:
I have domainA.com, domainB.com, domainC.com
if i create mail.domainA.com with the SSL and change all things, I will set everything to use only this SSL, correct?

My doubt is if the others domains will work using the SSL from the first.

Thank You!
Top

kandalf
Posts: 87
Joined: Tue May 13, 2014 11:53 pm

Re: How-To Exim+Dovecot+Vesta with SSL/TLS Let'sEncrypt
  • Quote

Post by kandalf » Sun Jul 15, 2018 12:00 am

I think this is a good solution. For me one important think that VestaCP should have is an option to automatically certify the mail.{domain}.tld of each domain on the server.
Top

adilsonb
Posts: 1
Joined: Thu Nov 15, 2018 11:48 pm

Os: CentOS 6x
Web: apache + nginx
Re: How-To Exim+Dovecot+Vesta with SSL/TLS Let'sEncrypt
  • Quote

Post by adilsonb » Thu Nov 15, 2018 11:58 pm

Hello danielz

I´m BR too :)

I have a problem, after adding this (with my settings):
First Step:
Find you DOVECOT directory, probably /etc/dovecot, then go to conf.d and edit this: 10-ssl.conf file.
Then add this config:

local_name mail.your-domain.tld {
ssl_cert = </usr/local/vesta/ssl/mail.your-domain.tld.pem
ssl_key = </usr/local/vesta/ssl/mail.your-domain.tld.key
}
The dovecot turns gray and will not start until I remove it.

Would you help me?
Top

Alex Connor
Support team
Posts: 1047
Joined: Fri Mar 21, 2014 7:49 am
Contact:
Contact Alex Connor
Website Twitter

Os: CentOS 6x
Web: apache + nginx
Re: How-To Exim+Dovecot+Vesta with SSL/TLS Let'sEncrypt
  • Quote

Post by Alex Connor » Mon Nov 26, 2018 9:24 pm

adilsonb wrote: ↑
Thu Nov 15, 2018 11:58 pm
The dovecot turns gray and will not start until I remove it.

Would you help me?
in my case I use next:

Code: Select all

ssl = yes
ssl_cert = </usr/local/vesta/ssl/mail.your-domain.tld.pem
ssl_key = </usr/local/vesta/ssl/mail.your-domain.tld.key
Top

dicarsio
Posts: 2
Joined: Tue Jun 25, 2019 1:59 am

Os: Debian 8x
Web: apache + nginx
Re: How-To Exim+Dovecot+Vesta with SSL/TLS Let'sEncrypt
  • Quote

Post by dicarsio » Tue Jun 25, 2019 2:16 am

Is this something that will be supported by VestaCP natively? It makes sense to support it somehow
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “Mail Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password