adding internal state tracking to mailer