I want to get certificates for mail server for used mail subdomain real domain.
So you need something like mail.mydomain.com (with mydomain.com being the actual domain you manage) for the mail server? Or is it mail.subdomain.mydomain.com?
Either case, do you have control over the DNS for mydomain.com or subdomain.mydomain.com? In other words, can you create DNS records in those domains? If you can then try the DNS challenge-response. They will give you a specific name or number record to add to that domain. If they can query that name/number that's the verification.
Or, do you have a web server running on mail.mydomain.com or mail.subdomain.mydomain.com? People often run their web mail on the same server for example. Then doing the http-01 challenge-response might be easier. In that case you need to set up a
/.well-known/acme-challenge directory on that web server and use the
--webroot
option. Certbot will write a random looking file there and Letsencrypt checks if that file exists by accessing the website.
If you have neither of those things you can run certbot in the 'standalone' mode. It will, temporarily, create the webserver on its own, you do need to allow access from the internet as that's how Letsencrypt does the verification.
I personally use the http-01 challenge-response as that was the easiest to set up for me. I already had a HAProxy up and running so it was fairly easy to add that
/.well-known/acme-challenge directory to it and redirect it to a local webserver. I should probably write this down some day, it would make a nice how-to.
Really, just follow the instructions:
https://certbot.eff.org/instructions