milter.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Pagure's Milter
  2. ===============
  3. `Milter <http://www.postfix.org/MILTER_README.html>`_ are script executed by
  4. postfix upon sending or receiving an email.
  5. We use this system to allow pagure's users to comment on a ticket (or a
  6. pull-request) by directly replying to the email sent as a notification.
  7. Pagure's milter is designed to be run on the same machine as the mail server
  8. (postfix by default). Postfix connecting to the milter via a unix socket.
  9. The milter itself is a service managed by systemd.
  10. You can find all the relevant files for the milter under the ``milters`` folder
  11. in the sources.
  12. Install the milter
  13. ------------------
  14. The first step to enable the milter on a pagure instance is thus to install the
  15. ``.service`` file for systemd and place the corresponding script that, by
  16. default, should go to ``/usr/share/pagure/comment_email_milter.py``.
  17. If you are using the RPM, install ``pagure-milters`` should provide and install
  18. all the files correctly.
  19. Activate the milter
  20. -------------------
  21. Make sure the milter is running and will be automaticall started at boot by
  22. running the commands:
  23. To start the milter:
  24. ::
  25. systemctl start pagure_milter
  26. To ensure the milter is always started at boot time:
  27. ::
  28. systemctl enable pagure_milter
  29. Activate the milter in postfix
  30. ------------------------------
  31. To actually activate the milter in postfix is in fact really easy, all it takes
  32. is two lines in the ``main.cf`` file of postfix:
  33. ::
  34. non_smtpd_milters = unix:/var/run/pagure/paguresock
  35. smtpd_milters = unix:/var/run/pagure/paguresock
  36. These two lines are pointing to the unix socket used by postfix to communicate
  37. with the milter. This socket is defined in the milter file itself, in the
  38. sources: ``milters/comment_email_milter.py``.