Heirloom mailx (formerly known as "nail") is derived from Berkeley Mail and provides the functionality of the System V and POSIX mailx commands. Additional features include support for MIME, IMAP (including caching and disconnected use), POP3, SMTP, S/MIME, international character sets, maildir folders, message threading, powerful search methods, scoring, and a Bayesian junk mail filter. Mailx can be used as a mail batch language in nearly the same way as it is used interactively. It can thus act as a mailbox filter, can fetch mail from remote accounts, and can send files as attachments.
JFetch is an application to download your email through protocols like POP3 and IMAP. The decision of whether to download a mail or not is made through a sequence of filters. By implementing certain interfaces, a user can very easily add his/her own filter to the current set of provided filters. Examples of filters are spam control, size restrictions, etc. JFetch downloads the email if it matches the criteria and then can deliver it using one of its delivery options.