저자: Michael Slusarz (slusarz@horde.org)
상속: extends Ingo_Rule_Addresses, implements Ingo_Rule_System
예제 #1
0
파일: SieveTest.php 프로젝트: horde/horde
    public function testWhitelist()
    {
        $wl = new Ingo_Rule_System_Whitelist();
        $wl->addAddresses('*****@*****.**');
        $this->storage->updateRule($wl);
        $this->_assertScript('if address :all :comparator "i;ascii-casemap" :is ["From", "Sender", "Resent-From"] "*****@*****.**"  {
keep;
stop;
}');
    }
예제 #2
0
파일: ScriptTest.php 프로젝트: horde/horde
 function testPartialWhitelistAddressShouldNotMatch()
 {
     $runner = ScriptTester::factory('all', $this);
     $bl = new Ingo_Rule_System_Blacklist();
     $bl->addAddresses('*****@*****.**');
     $runner->addRule($bl);
     $wl = new Ingo_Rule_System_Whitelist();
     $wl->addAddresses('*****@*****.**');
     $runner->addRule($wl);
     $runner->assertDeletesMessage('from_spammer');
 }
예제 #3
0
    public function testWhitelist()
    {
        $wl = new Ingo_Rule_System_Whitelist();
        $wl->addAddresses('*****@*****.**');
        $this->storage->updateRule($wl);
        $this->_assertScript(':0
* ^From:(.*\\<)?spammer@example\\.com
$DEFAULT');
    }
예제 #4
0
    public function testWhitelist()
    {
        $wl = new Ingo_Rule_System_Whitelist();
        $wl->addAddresses('*****@*****.**');
        $this->storage->updateRule($wl);
        $this->_assertScript('if( \\
/^From:\\s*.*spammer@example\\.com/:h \\
)
exception {
to "${DEFAULT}"
}');
    }