On my server I installed Postfix and Dovecot and Apache2 on Ubuntu.
I bought a SSL certificate and used that to secure the website. This works fine.
Now I want to configure Postfix and Dovecot with the same certificate so that I can use my mail server with SSL too. But when I set it up on my gmail app on the phone, I get this:
Certificate not trusted
Subject: kanzan.se
Issuer: AlphaSSL CA - SHA256 - G2
Valid from: Jul 3, 2018
Expires on: Jul 4, 2019
Current date: Jul 6, 2018
PEM encoded chain: -----BEGIN CERTIFICATE-----
MIIFzTCCBLWgAwIBAgIMdmzZXlCIkPQV/MbvMA0GCSqGSIb3DQEBCwUAMEwxCzAJBgN...
This is my configurations:
/etc/postfix/main.cf:
smtpd_tls_cert_file=/etc/ssl/certs/kanzan_cert_comb.crt
smtpd_tls_key_file=/etc/ssl/private/kanzan_ssl.key
smtpd_use_tls=yes
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_sender_login_maps = hash:/etc/postfix/controlled_envelope_senders
smtpd_recipient_restrictions = permit_sasl_authenticated
#reject_sender_login_mismatch
/etc/dovecot/conf.d/10-ssl.conf:
ssl = yes
ssl_cert = </etc/ssl/certs/kanzan_cert_comb.crt
ssl_key = </etc/ssl/private/kanzan_ssl.key
/etc/postfix/master.cf:
submission inet n - y - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=may
-o smtpd_sasl_auth_enable=yes
smtps inet n - y - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
First of all, can I use the same certificate for mail and the website? (same domain). I added a MX record to my DNS which points to this domain, kanzan.se.
Are my configs right?