mailinfo: get rid of function-local static states