gunnar: server/php-kolab/Kolab_Filter/tests privileged_network.phpt, NONE, 1.1
cvs at kolab.org
cvs at kolab.org
Tue Feb 12 08:39:14 CET 2008
Author: gunnar
Update of /kolabrepository/server/php-kolab/Kolab_Filter/tests
In directory doto:/tmp/cvs-serv27370/php-kolab/Kolab_Filter/tests
Added Files:
privileged_network.phpt
Log Message:
Added a unit test for the new privileged network setting.
--- NEW FILE: privileged_network.phpt ---
--TEST--
Test sending a mail as an untrusted sender.
--SKIPIF--
--FILE--
<?php
require_once 'Kolab/Filter/Content.php';
/* Our test configuration */
$conf = array();
$conf['log']['enabled'] = true;
$conf['log']['priority'] = PEAR_LOG_DEBUG; // Leave this on DEBUG for now. We just restructured the package...
$conf['log']['type'] = 'console';
$conf['log']['name'] = 'ignored';
$conf['log']['ident'] = 'Kolab Filter';
$conf['log']['params']['append'] = true;
$conf['filter']['tempdir'] = './tmp';
$conf['filter']['reject_forged_from_header'] = false;
$conf['filter']['email_domain'] = 'example.com';
$conf['filter']['privileged_networks'] = '192.168.0.0/16';
$_SERVER['argv'] = array('test', '-s', 'me at example.com', '-r', 'you at example.com', '-c', '192.168.178.1');
$logger = Horde::getLogger();
$logger->_lineFormat = '%2$s [%3$s] %7$s';
// Activate this if you need the log information. This will
// make the test fail though
//$logger->_lineFormat = '%2$s [%3$s] %4$s %7$s';
$inh = fopen('_data/forged.eml', 'r');
/* Setup the class */
$parser = &new Filter_Content('StdOut', true);
/* Parse the mail */
$parser->parse($inh);
?>
--EXPECT--
Kolab Filter [debug] logMessage
Kolab Filter [debug] logMessage
Mail from sender: me at example.com
Mail to recipient: you at example.com
Return-Path: <me at example.com>
Received: from localhost (fqdn.example.com [127.0.0.1])
by demo.example.com (Cyrus v2.3.9-openpkg) with LMTPA;
Sat, 10 Nov 2007 20:44:52 +0100
Message-ID: <1d2101c823d2$3555aa10$ac112c15 at Meredith>
From: "Me" <me at example.com>
To: "You" <you at example.com>
Subject: Me to You
Date: Sat, 10 Nov 2007 22:45:12 +0300
User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
test
.
Kolab Filter [info] logMessage
More information about the commits
mailing list