gunnar: server/php-kolab/Kolab_Filter/tests forged_vacation_msg.phpt, NONE, 1.1 forged_sender.phpt, 1.2, 1.3 privileged_network.phpt, 1.1, 1.2

cvs at kolab.org cvs at kolab.org
Wed Feb 27 08:09:58 CET 2008


Author: gunnar

Update of /kolabrepository/server/php-kolab/Kolab_Filter/tests
In directory doto:/tmp/cvs-serv10323/Kolab_Filter/tests

Modified Files:
	forged_sender.phpt privileged_network.phpt 
Added Files:
	forged_vacation_msg.phpt 
Log Message:
Add a test fo rkolab/issue1272 and fix a notice when the sender does only use a mail address (no plain text name.

--- NEW FILE: forged_vacation_msg.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';

/* Use an empty client address here, indicating that the mail is sent
 * via local sendmail -> We want to trust local sendmail */
$_SERVER['argv'] = array('test', '-s', 'me at example.com', '-u', '', '-r', 'you at example.net', '-c', '');
$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/vacation.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.net
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 at example.com
To: you at example.net
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

I'm on vacation
.
Kolab Filter [info] logMessage

Index: forged_sender.phpt
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/tests/forged_sender.phpt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- forged_sender.phpt	12 Feb 2008 09:54:37 -0000	1.2
+++ forged_sender.phpt	27 Feb 2008 07:09:56 -0000	1.3
@@ -44,7 +44,7 @@
 	 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 (UNTRUSTED, sender <me at example.com> is not authenticated)" <me at example.com>
+From: " (UNTRUSTED, sender <me at example.com> is not authenticated)" <me at example.com>
 To: "You" <you at example.com>
 Subject: Me to You
 Date: Sat, 10 Nov 2007 22:45:12 +0300

Index: privileged_network.phpt
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/tests/privileged_network.phpt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- privileged_network.phpt	12 Feb 2008 07:39:12 -0000	1.1
+++ privileged_network.phpt	27 Feb 2008 07:09:56 -0000	1.2
@@ -43,7 +43,7 @@
 	 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>
+From: me at example.com
 To: "You" <you at example.com>
 Subject: Me to You
 Date: Sat, 10 Nov 2007 22:45:12 +0300





More information about the commits mailing list