Created Tuesday 25 November 2014
Bashpop3 was started mostly as an exercise for getting familiar with the bash script environment but then I got hooked into making a usable tool that others might be interested in using or extending too.  It gives access to your POP3 server from the bash command line and should work well in any recent version of the Linux shell just as long as it supports co-processes.
WARNING: As with all POP3 server access bear in mind that your POP3 password is transmitted in plain text therefore avoid using it when connected to a public wifi access point.
In order to use this script on your POP3 server you first need to add your email address and POP3 server names to the USER= and HOST= line near the top of the script.  For security you are prompted for your password each time you run the script to avoid this being visible to anyone listing the script later.  You can even add the -s switch on the read command on line 8 if you don't wish your password to be echoed to the console.
This script is based on a stack overflow post at http://stackoverflow.com/questions/5911032/whats-the-best-method-for-retrieving-sender-subject-from-a-pop3-acct-via-the-c by Seth Robertson.  Just reading through his script was quite an education in how powerful shell scripts can be and was an excellent way of advancing my knowledge beyond the basic scripting concepts.  The script in the stack overflow post just listed a brief summary of the email headers then exited.  I have extended that script so I can list the full header or a sizeable chunk of the body of selected emails on the server and further extended it to allow the user to selectively delete mail from the server without having to download messages first.  Deleting email from the server is quite handy if you are suffering with a lot of spam or someone sends you a monster attachment that you really don't want to download.  
If you wish to extend or improve the script then first read the detailed description of the Bashpop3Script here.  Then download the bash file from
https://github.com/doubledodge/bashpop3
One improvements I would like to see is the ability to filter out all the HTML formatting from an email, just leaving the unadorned text and links when I list the email body.  I really want to keep the script fairly short however if it can be done in a few lines  I would be very pleased to merge in to this project any well written and tested modifications that add this feature.  
The script could be easily extended to check more than one POP3 account or download messages to the user's machine but I think these facilities should be a fork from the this project which aims to keep the script as a slick, quick pre-download mail tool 
This documentation has been written using ZIM http://www.zim-wiki.org  and  converted to HTML readable format from within ZIM.  The ZIM notebook is stored on https://github.com/doubledodge/doubledodge.github.io so is available for modification and updating.  If you wish to add to the documentation please edit the ZIM text files rather than try and modify the HTML it has auto-generated.