EsmtpHandler.php 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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, $command, $codes = array(), &$failedRecipients = null, &$stop = false);
  51. /**
  52. * Returns +1, -1 or 0 according to the rules for usort().
  53. * This method is called to ensure extensions can be execute in an appropriate order.
  54. * @param string $esmtpKeyword to compare with
  55. * @return int
  56. */
  57. public function getPriorityOver($esmtpKeyword);
  58. /**
  59. * Returns an array of method names which are exposed to the Esmtp class.
  60. * @return string[]
  61. */
  62. public function exposeMixinMethods();
  63. /**
  64. * Tells this handler to clear any buffers and reset its state.
  65. */
  66. public function resetState();
  67. }