importvalidmatcher.java

来自「开源项目CRM之OpenCustomer」· Java 代码 · 共 26 行

JAVA
26
字号
package org.opencustomer.mail.james;

import java.util.Collection;

import javax.mail.MessagingException;

import org.apache.mailet.GenericMatcher;
import org.apache.mailet.Mail;

public class ImportValidMatcher extends GenericMatcher
{
    private String attributeName = "james2oc";

    public String getMatcherInfo()
    {
        return "Has OpenCustomer Attribute";
    }

    public Collection match(Mail mail) throws MessagingException
    {
        if (mail.getAttribute(attributeName) != null)
            return mail.getRecipients();
        return null;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?