def _apply_common_rules(self, part, maxlength):
        """This method contains the rules that must be applied to both the
        domain and the local part of the e-mail address.
        """
        part = part.strip()
        
        if self.fix:
            part = part.strip('.')
        
        if not part:
            return part, 'It cannot be empty.'
        
        if len(part) > maxlength:
            return part, 'It cannot be longer than %i chars.' % maxlength
        
        if part[0] == '.':
            return part, 'It cannot start with a dot.'
        
        if part[-1] == '.':
            return part, 'It cannot end with a dot.'
        
        if '..' in part:
            return part, 'It cannot contain consecutive dots.'
        
        return part, ''
dataset/ETHPy150Open marrow/mailer/marrow/mailer/validator.py/DomainValidator._apply_common_rules/original