System Requirements - Mac
Instruction Link -https://getcomposer.org/download/
Using the above link you will find command to install composer on Mac.
In Mac, PHP automatically comes with MAMP even you can download it according to your requirements of PHP Version and also can switch PHP versions easily.
Install Mailparse Extension in Mac using below structured command:
pecl install mailparse
After successful execution of the command, you need to add "extension=mailparse.so" in php.ini file of the PHP version you are using.
Note:-Sometimes you will not get pre-installed pecl in MAC so in that case you need to install pecl first following the link given below:
MAMP comes with pre-installed IMAP Extension, you just need to uncomment the IMAP Extension from php.ini file of PHP version which you are using, it will reflect/work after restarting apache services.