There is a section in the manual on Nagios: http://docs.software-univention.de/manual-4.2.html#nagios::general
You can go to the Nagios UMC module and add a service entry.
For IMAP that’d be:
Name=IMAP
Plugin command=check_imap
Plugin command arguments=-p 143
Use NRPE=yes
Click Tab “Hosts” → add the host(s) to check.
For IMAPS it’s a bit more complicated, because there currently seems to be a problem with a parser.
Name=IMAPS
Plugin command=check_imap
Plugin command arguments=-S' '-p 993
Use NRPE=yes
Click Tab “Hosts” → add the host(s) to check.
Then restart Nagios:
systemctl restart nagios3.service
The new service checks should now be shown in the Nagios “Service Detail” view.
Use /usr/lib/nagios/plugins/check_imap --help
if you need further options.
For POP3 do the same as for IMAP.
Greetings
Daniel Tröder