Run a script everytime the impersonate facility is used

Add a perl example script that can be used from dovecot post login script as well.
Removed useless closing php tag
Removed some trailing spaces ant tabs