You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // \file PostfixMilterConf.hpp
  2. //
  3. // Copyright (C) 2011 ARM Research Labs, LLC.
  4. // See www.armresearch.com for the copyright terms.
  5. //
  6. // This file defines the PostfixMilterConf interface.
  7. //
  8. // $Id$
  9. //
  10. ///////////////////////////////////////////////////////////////////////////////////////////////////
  11. #ifndef PostfixMilterConfhpp_included
  12. #define PostfixMilterConfhpp_included
  13. #include <string>
  14. /// Class to update smtpd_milters line in the postfix main.cf file.
  15. //
  16. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  17. class PostfixMilterConf {
  18. public:
  19. /// Load a new configuration line.
  20. void ConfLine(std::string Line);
  21. /// Check whether the configuration line indicates that SNFMilter is integrated.
  22. //
  23. // \returns true if the line indicates integration, false otherwise.
  24. //
  25. bool IsIntegrated();
  26. /// Update the configuration line to integrate with SNFMilter.
  27. void AddIntegration();
  28. /// Update the configuration line to remove integration with SNFMilter.
  29. void RemoveIntegration();
  30. /// Get a copy of the configuration line.
  31. std::string ConfLine();
  32. /// Check whether the configuration line is a milter specification.
  33. //
  34. // \returns true if the configuration line is a milter
  35. // specification, false otherwise.
  36. //
  37. bool IsMilterLine();
  38. private:
  39. /// Check whether the configuration line contains a SNFMilter soecket specification.
  40. //
  41. // \returns true if the configuration line contains a SNFMilter
  42. // socket specification, false otherwise.
  43. //
  44. bool ContainsSnfMilterSocketSpec();
  45. /// Configuration line.
  46. std::string ConfigurationLine;
  47. };
  48. #endif