With self-signed certificates there are two ways to get client devices to trust them. Either you manually and normally only once trust that individual server certificate, or you do the same but instead trust the self-signed rootCA used to create that server certificate.
Since most organisations use more than one certificate it is usually much easier to distribute a copy of the self-signed rootCA certificate to all the devices and trust that on each device and then any subsequent server certificates should automatically be trusted as you would have already trusted the rootCA that created it.
You can open Keychain Assistant on your client Macs and trust this individual mail server certificate which should normally be stored in the System keychain. Similarly if you have distributed a copy of the self-signed rootCA you can find it in the same place and trust it as well. (Once the self-signed rootCA is installed and trusted the server certificate should automatically be trusted.)
There are various ways to distribute certificates including a self-signed rootCA and to automate trusting it. One of the easiest is if you are using Apple Profile Manager. You would use Profile Manager to create a 'Trust Profile' and install that on each client device. This Trust Profile can be either installed manually just by double-clicking on it, or automatically via a shell-script or by incorporating it inside an Apple Package installer, or via various Mac management tools including DeployStudio.