1: <?php
2:
3: /*
4: * This file is part of SwiftMailer.
5: * (c) 2004-2009 Chris Corbyn
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: /**
12: * An ESMTP handler.
13: * @package Swift
14: * @subpackage Transport
15: * @author Chris Corbyn
16: */
17: interface Swift_Transport_EsmtpHandler
18: {
19: /**
20: * Get the name of the ESMTP extension this handles.
21: * @return boolean
22: */
23: public function getHandledKeyword();
24:
25: /**
26: * Set the parameters which the EHLO greeting indicated.
27: * @param string[] $parameters
28: */
29: public function setKeywordParams(array $parameters);
30:
31: /**
32: * Runs immediately after a EHLO has been issued.
33: * @param Swift_Transport_SmtpAgent $agent to read/write
34: */
35: public function afterEhlo(Swift_Transport_SmtpAgent $agent);
36:
37: /**
38: * Get params which are appended to MAIL FROM:<>.
39: * @return string[]
40: */
41: public function getMailParams();
42:
43: /**
44: * Get params which are appended to RCPT TO:<>.
45: * @return string[]
46: */
47: public function getRcptParams();
48:
49: /**
50: * Runs when a command is due to be sent.
51: * @param Swift_Transport_SmtpAgent $agent to read/write
52: * @param string $command to send
53: * @param int[] $codes expected in response
54: * @param string[] &$failedRecipients
55: * @param boolean &$stop to be set true if the command is now sent
56: */
57: public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = array(), &$failedRecipients = null, &$stop = false);
58:
59: /**
60: * Returns +1, -1 or 0 according to the rules for usort().
61: * This method is called to ensure extensions can be execute in an appropriate order.
62: * @param string $esmtpKeyword to compare with
63: * @return int
64: */
65: public function getPriorityOver($esmtpKeyword);
66:
67: /**
68: * Returns an array of method names which are exposed to the Esmtp class.
69: * @return string[]
70: */
71: public function exposeMixinMethods();
72:
73: /**
74: * Tells this handler to clear any buffers and reset its state.
75: */
76: public function resetState();
77: }
78: