add debug() wrapper and correct encoding mixup

a function debug() wrap syslog messages can be disable in list config.
Test mail making crash with unicode vs str encoding, first correction.
The test content need to be added.