Exemple #1
0
//IsAllowed returns fase if n is not allowed and denied.
func (n *Node) IsAllowed() bool {
	nodeAllow := util.NewRegexpList(cfg.NodeAllowFile)
	nodeDeny := util.NewRegexpList(cfg.NodeDenyFile)

	if !nodeAllow.Check(n.Nodestr) && nodeDeny.Check(n.Nodestr) {
		return false
	}
	return true
}
//IsSpam returns true if Recstr is listed in spam.txt
func (r *Record) IsSpam() bool {
	if cachedRule == nil {
		cachedRule = util.NewRegexpList(cfg.SpamList)
	}
	return cachedRule.Check(r.Recstr())
}