You can add A and/or CNAME records for smtp.example.com and imap.example.com as usual in your zone file, e.g.
smtp A x.x.x.x
imap CNAME smtp
but you don't need to specify the ports. These are the default ports used by smtp and imap servers.
There is an experimental RR (SRV
) that in theory can define an imap server in a zone, but better not rely on that
As a side note: it's always better not to use a CNAME for the host defined by the MX RR, but use an A RR instead