Subversion Repositories SmartDukaan

Rev

Rev 78 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

def getscore(struct) :
    
    score = 0
    
    if struct.has_key("features") :
        features = struct.get("features")
        
        # Protocols : Mail for Exchange-3, POP3-1, SMTP-1, IMAP-1, IMAP4-1
        if features.has_key("Protocols") :
            ps = features.get("Protocols")
            
            if "Mail for Exchange" in ps :
                score += 3

            if "POP3" in ps :
                score += 1
                
            if "SMTP" in ps :
                score += 1
                
            if "IMAP" in ps :
                score += 1
                
            if "IMAP4" in ps :
                score += 1
                
    return score