EsmtpHandler.php 2.3KB

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