kryptos
Now the problem is that after this configuration when we send emails it always say's certificate mismatch.That is why I thought a valid certificate could suppress those messages from coming back. Just enlighten me why I have encountered certificate mismatch when sending emails.
A self signed certificate IS a valid certificate, it's just that your browser/email client does not recognize it.
The only difference having a commercial certificate will make is that the knowledge of your certificate is in the root certificate that is installed to your browsers by default, therefore you don't receive warnings.
You can install the self signed certificate into the root certificate folder in your browser the first time you access https and you should no longer get errors/warnings.
One "issue" with using the self signed certificate is that you may be accessing your mail server using a different host name than the certificate has, therefore the mismatch.
For your mail server hostname (in your email clients) try using servername.yourdomain.com rather than say mail.yourdomain.com.
Alternatively you can set the common name for your self signed certificate with a db command eg to
www.yourdomain.com and then set your email clients to access your mail server using that same hostname.
See
http://wiki.contribs.org/Certificatewhich says
config setprop modSSL CommonName
www.domain.comexpand-template /home/e-smith/ssl.crt/crt
expand-template /home/e-smith/ssl.key/key
signal-event domain-modify
signal-event email-update