1: <?php
2: /**
3: * @package Kolab_Filter
4: */
5:
6: /**
7: * Drops a mail instead of delivering it.
8: *
9: * Copyright 2008 Klarälvdalens Datakonsult AB
10: *
11: * See the enclosed file COPYING for license information (LGPL). If you
12: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
13: *
14: * @author Gunnar Wrobel <wrobel@pardus.de>
15: * @package Kolab_Filter
16: */
17: class Horde_Kolab_Filter_Transport_drop extends Horde_Kolab_Filter_Transport
18: {
19: /**
20: * Create the transport handler.
21: *
22: * @return DropWrapper Provides a null class as transport.
23: */
24: function _createTransport()
25: {
26: $transport = new DropWrapper();
27: return $transport;
28: }
29: }
30:
31: /**
32: * Defines a wrapper that provides functionality comparable to the
33: * Net/*MTP.php classes.
34: *
35: * Copyright 2008 Klarälvdalens Datakonsult AB
36: *
37: * See the enclosed file COPYING for license information (LGPL). If you
38: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
39: *
40: * @author Gunnar Wrobel <wrobel@pardus.de>
41: * @package Kolab_Filter
42: */
43: class DropWrapper
44: {
45: /**
46: * Pretends to connect.
47: *
48: * @return boolean Always true.
49: */
50: function connect()
51: {
52: return true;
53: }
54:
55: /**
56: * Pretends to disconnect.
57: *
58: * @return boolean Always true.
59: */
60: function disconnect()
61: {
62: return true;
63: }
64:
65: /**
66: * Set the sender.
67: *
68: * @return boolean Always true.
69: */
70: function mailFrom($sender)
71: {
72: return true;
73: }
74:
75: /**
76: * Set the recipient.
77: *
78: * @return boolean Always true.
79: */
80: function rcptTo($recipient)
81: {
82: return true;
83: }
84:
85: /**
86: * Pretends to send commands.
87: *
88: * @param string $cmd The command.
89: *
90: * @return boolean Always true.
91: */
92: function _put($cmd)
93: {
94: return true;
95: }
96:
97: /**
98: * Pretends to handle responses.
99: *
100: * @param string $code The response to parse.
101: *
102: * @return boolean Always true.
103: */
104: function _parseResponse($code)
105: {
106: return true;
107: }
108:
109: /**
110: * Write data.
111: *
112: * @param string $data The data to write.
113: *
114: * @return boolean Always true.
115: */
116: function _send($data)
117: {
118: return true;
119: }
120: }
121: