<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_maildirs(ctx, param, value):
 """ Check that folders are maildirs. """

    for path in value:
        for subdir in MD_SUBDIRS:
            if not os.path.isdir(os.path.join(path, subdir)):
                raise click.BadParameter(
                    '{} is not a maildir (missing {!r} sub-directory).'.format(
                        path, subdir))
    return value