I have to setup an internal email server in such a way that whenever a new email is received, it should notify a php cli script with all its contents. We have lamp on Ubuntu 14.04 but have not setup the email server so have choice to select any according to this requirement.
You can use mailgun.com, You can set your email address to work with mailgun.com and create script that will accept email contents as post request, sent by mailgun's webhook.