I need a Java script that runs on a machine, listens for incoming emails, accepts the emails, and then puts the email into a folder on the machine. All of this needs to be done in the absence of an email server. This would essentially take the place of an email server. It doesn't need to send out emails or anything, just accept them.
The script should have a place to validate the TO/FROM addresses before accepting the email. I will take care of the validation. Just put the TO and FROM email addresses in variables and mark that place.