Postfix

Mail server.

Config Local Only
The first two lines set the name and domain of the mail system to special names. The variable inet_interfaces lists the network interface addresses on which mail are received. The variable mydestination specifies the list of domains for which the machine considers itself the final destination. Modify all these lines to read exactly as above.

Pop3
To configur a secure pop3 server see: Courier-imap.

Mail checking
If you use bash :

For more explanation : man bash