'Create a mail in  maildir \'folder\'/new
Use default mailfilename if not given.
Use some default content if not given'

@classmethod
def create_mail(cls, folder, mailfile=None, content=None):

    assert (cls.testdir != None)
    while True:
        mailfile = '{0}:2,'.format(random.randint(0, 999999999))
        mailfilepath = os.path.join(cls.testdir, 'mail', folder, 'new', mailfile)
        if (not os.path.isfile(mailfilepath)):
            break
    with open(mailfilepath, 'wb') as mailf:
        mailf.write('From:    test    <test@offlineimap.org>\nSubject:    Boo\nDate:    1    Jan    1980\nTo:    test@offlineimap.org\n\nContent    here.')
