moving MAILCONF variable outside of loop for persistence