Implements DB storage and mail_action system