install_pagure_milter.rst 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Installing pagure's milter
  2. ==========================
  3. A milter is a script that is ran by a Mail Transfer Agent (`MTA
  4. <https://en.wikipedia.org/wiki/Message_transfer_agent>`_)
  5. upon receiving an email via either a network or an unix socket.
  6. If you want more information feel free to check out the corresponding page
  7. on wikipedia: `https://en.wikipedia.org/wiki/Milter
  8. <https://en.wikipedia.org/wiki/Milter>`_.
  9. Configure your system
  10. ---------------------
  11. * Install the required dependencies
  12. ::
  13. python-pymilter
  14. .. note:: We ship a systemd unit file for pagure_milter but we welcome patches
  15. for scripts for other init systems.
  16. .. note:: It also requires a MTA, we used postfix.
  17. * Create an alias ``reply``
  18. This can be done in ``/etc/aliases``, for example:
  19. ::
  20. reply: /dev/null
  21. * Activate the ability of your MTA, to split users based on the character ``+``.
  22. This way all the emails sent to ``reply+...@example.com`` will be forwarded
  23. to your alias for ``reply``.
  24. In postfix this is done via:
  25. ::
  26. recipient_delimiter = +
  27. * Hook the milter in the MTA
  28. In postfix this is done via:
  29. ::
  30. non_smtpd_milters = unix:/var/run/pagure/paguresock
  31. smtpd_milters = unix:/var/run/pagure/paguresock
  32. * Install the files of the milter as follow:
  33. +---------------------------------------------+---------------------------------------------------+
  34. | Source | Destination |
  35. +=============================================+===================================================+
  36. | ``pagure-milters/comment_email_milter.py`` | ``/usr/share/pagure/comment_email_milter.py`` |
  37. +---------------------------------------------+---------------------------------------------------+
  38. | ``pagure-milters/milter_tempfile.conf`` | ``/usr/lib/tmpfiles.d/pagure-milter.conf`` |
  39. +---------------------------------------------+---------------------------------------------------+
  40. | ``pagure-milters/pagure_milter.service`` | ``/etc/systemd/system/pagure_milter.service`` |
  41. +---------------------------------------------+---------------------------------------------------+
  42. The first file is the script of the milter itself.
  43. The second file is a file specific for systemd and ensuring the temporary
  44. folders needed by the milter are re-created if needed at each boot.
  45. The third file is the systemd service file.
  46. * Activate the service and ensure it's started upon boot:
  47. ::
  48. systemctl enable pagure_milter
  49. systemctl start pagure_milter