Run script on email recieve

Hi, I need to run a script or a software as soon as an email received with a keyword into my inbox. how can i do this?