updated emailer permissions for cancel & fixed changing passwords

Updated the permissions for canceling an unsent email to be the same
as the view email permissions

I have also fixed changing passwords where error messages are not
displaying. The reason was an invalid index used (spelling).
fixed some pmd error

Mainly the errors were unused local variables