Item12952: Apply mailProgram changes

Partially tested.   jsonrpc keeps looping instead of saving the
configuration.  So testing is blocked for now.

Loops, 100% cpu,  jsonrpc: Use of uninitialized value
$Foswiki::cfg{"DataDir"}   Single post loops on the server side.