This thread was really helpful, however when I tried to install mailparse (3.1.2) from WHM > Module Installers > PHP PECL (Manage) on our CloudLinux 7.9 instance running cPanel v98.x.x, I got the following error message:
re2c: command not found
...
ERROR: `make' failed
To install re2c on a cPanel system, I found this article published by cPanel:
https://support.cpanel.net/hc/en-us/articles/1500000966161-How-to-install-the-MailParse-PHP-extension
And ran the given commands at the Terminal:
Install the EPEL repository if not already installed.
yum install epel-release
Install the re2c package from EPEL if not already installed.
yum install re2c
Thereafter, I simply went back to WHM > Module Installers > PHP PECL (Manage) and mailparse installed just fine.
I hope this helps!