Ticket #464
Ticket #463
Improved mail component
replaced plain values by globals(roleID and state)
some cleanup