in reply to how to detect an email ?

See Email::Filter and cohorts. It's very simple to write extensive mail filters with it.