initial mailconfig_type
boolean treatment
added some validation
some state with encoding and new name
working version