list_mailer.lua: some refactoring