Mailx is derived from Berkeley Mail and is intended provide the functionality of the POSIX mailx command with additional support for MIME, IMAP, POP3, SMTP, and S/MIME. It provides enhanced features for interactive use, such as caching and disconnected operation for IMAP, message threading, scoring, and filtering. It is also usable as a mail batch language, both for sending and receiving mail.
To compile and install mailx, look at the file 'INSTALL'.