From what I can tell, kdepim-runtime needs to be installed for kmail to work. Without it, kmail crashes every time it starts, giving an error about being "unable to obtain agent type." akonadiconsole shows akonadi to be running, but whatever it is that kmail needs from it, it's not getting. Installing kdepim-runtime fixed the problem. I had not previously, explicitly installed any kdepim-related package except for kmail. So, the kdepim-related packages that got pulled in were just those that kmail depends on (directly or indirectly), and kdepim-runtime was not one of them, and it sure looks like it needs to be. For kde4, kmail was part of the kdepim package (now kdepim-kde4), which depends on kdepim-runtime-kde4, so when you installed kmail, you got kdepim-runtime-kde4 out of the deal. It looks like when kmail was split out of kdepim for kde 5, the runtime dependency on kdepim-runtime was overlooked.
A commit references this bug: Author: tcberner Date: Thu Aug 2 10:22:46 UTC 2018 New revision: 476229 URL: https://svnweb.freebsd.org/changeset/ports/476229 Log: Add missing runtime dependency on kdepim-runtime PR: 230086 Reported by: Jonathan M Davis <freebsd.bugs@jmdavisprog.com> Changes: head/Mk/Uses/kde.mk head/deskutils/kaddressbook/Makefile head/deskutils/kalarm/Makefile head/deskutils/kmail/Makefile head/deskutils/knotes/Makefile head/deskutils/korganizer/Makefile head/deskutils/zanshin/Makefile
The dependeny has been added. Thanks :)