cloned from https://github.com/pdobb/mail-mad_mimi