EsmtpHandler.php 2.3 KB

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