EsmtpHandler.php 2.0KB

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