commentail 1.3.2__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. {commentail-1.3.2 → commentail-1.4.0}/CHANGELOG.md +23 -0
  2. {commentail-1.3.2/commentail.egg-info → commentail-1.4.0}/PKG-INFO +16 -2
  3. {commentail-1.3.2 → commentail-1.4.0}/README.md +15 -1
  4. {commentail-1.3.2 → commentail-1.4.0}/README.ru.md +17 -3
  5. {commentail-1.3.2 → commentail-1.4.0}/commentail/admission.py +1 -14
  6. commentail-1.4.0/commentail/checks.py +12 -0
  7. commentail-1.4.0/commentail/email.py +148 -0
  8. {commentail-1.3.2 → commentail-1.4.0}/commentail/forms.py +10 -1
  9. commentail-1.4.0/commentail/locale/de/LC_MESSAGES/django.mo +0 -0
  10. {commentail-1.3.2 → commentail-1.4.0}/commentail/locale/de/LC_MESSAGES/django.po +24 -0
  11. commentail-1.4.0/commentail/locale/es/LC_MESSAGES/django.mo +0 -0
  12. {commentail-1.3.2 → commentail-1.4.0}/commentail/locale/es/LC_MESSAGES/django.po +24 -0
  13. commentail-1.4.0/commentail/locale/fr/LC_MESSAGES/django.mo +0 -0
  14. {commentail-1.3.2 → commentail-1.4.0}/commentail/locale/fr/LC_MESSAGES/django.po +24 -0
  15. commentail-1.4.0/commentail/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  16. {commentail-1.3.2 → commentail-1.4.0}/commentail/locale/pt_BR/LC_MESSAGES/django.po +24 -0
  17. commentail-1.4.0/commentail/locale/ru/LC_MESSAGES/django.mo +0 -0
  18. {commentail-1.3.2 → commentail-1.4.0}/commentail/locale/ru/LC_MESSAGES/django.po +24 -0
  19. commentail-1.4.0/commentail/management/commands/test_commentail_email.py +57 -0
  20. commentail-1.4.0/commentail/migrations/0019_moderation_rule_reason.py +20 -0
  21. {commentail-1.3.2 → commentail-1.4.0}/commentail/models.py +1 -0
  22. {commentail-1.3.2 → commentail-1.4.0}/commentail/outbox.py +12 -4
  23. {commentail-1.3.2 → commentail-1.4.0}/commentail/policies.py +36 -17
  24. {commentail-1.3.2 → commentail-1.4.0}/commentail/rules_csv.py +45 -10
  25. {commentail-1.3.2 → commentail-1.4.0}/commentail/services.py +16 -3
  26. {commentail-1.3.2 → commentail-1.4.0}/commentail/static/commentail/admin.css +1 -0
  27. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/rules_import.html +5 -3
  28. {commentail-1.3.2 → commentail-1.4.0/commentail.egg-info}/PKG-INFO +16 -2
  29. {commentail-1.3.2 → commentail-1.4.0}/commentail.egg-info/SOURCES.txt +13 -0
  30. commentail-1.4.0/docs/releases/1.4.0.md +82 -0
  31. commentail-1.4.0/docs/releases/1.4.0.ru.md +85 -0
  32. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Changelog.md +23 -0
  33. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Configuration.md +5 -1
  34. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Email-and-worker.md +9 -4
  35. commentail-1.4.0/docs/wiki/Email-configuration-ru.md +160 -0
  36. commentail-1.4.0/docs/wiki/Email-configuration.md +157 -0
  37. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Guest-comments.md +8 -1
  38. commentail-1.4.0/docs/wiki/Home-ru.md +89 -0
  39. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Home.md +18 -0
  40. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Moderation.md +5 -1
  41. commentail-1.4.0/docs/wiki/Release-1.4.0-ru.md +85 -0
  42. commentail-1.4.0/docs/wiki/Release-1.4.0.md +82 -0
  43. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Roadmap.md +25 -14
  44. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Rules-and-CSV.md +23 -7
  45. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Stability.md +4 -1
  46. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Troubleshooting.md +2 -0
  47. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/_Sidebar.md +7 -0
  48. {commentail-1.3.2 → commentail-1.4.0}/pyproject.toml +1 -1
  49. {commentail-1.3.2 → commentail-1.4.0}/tests/test_content_checks.py +3 -3
  50. commentail-1.4.0/tests/test_early_rejection.py +175 -0
  51. commentail-1.4.0/tests/test_independent_email.py +568 -0
  52. {commentail-1.3.2 → commentail-1.4.0}/tests/test_lifecycle.py +9 -11
  53. {commentail-1.3.2 → commentail-1.4.0}/tests/test_rules_admin.py +8 -1
  54. {commentail-1.3.2 → commentail-1.4.0}/tests/test_rules_csv.py +47 -0
  55. commentail-1.4.0/tests/test_test_email_command.py +149 -0
  56. commentail-1.3.2/commentail/checks.py +0 -8
  57. commentail-1.3.2/commentail/locale/de/LC_MESSAGES/django.mo +0 -0
  58. commentail-1.3.2/commentail/locale/es/LC_MESSAGES/django.mo +0 -0
  59. commentail-1.3.2/commentail/locale/fr/LC_MESSAGES/django.mo +0 -0
  60. commentail-1.3.2/commentail/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  61. commentail-1.3.2/commentail/locale/ru/LC_MESSAGES/django.mo +0 -0
  62. {commentail-1.3.2 → commentail-1.4.0}/LICENSE +0 -0
  63. {commentail-1.3.2 → commentail-1.4.0}/MANIFEST.in +0 -0
  64. {commentail-1.3.2 → commentail-1.4.0}/commentail/__init__.py +0 -0
  65. {commentail-1.3.2 → commentail-1.4.0}/commentail/admin_queries.py +0 -0
  66. {commentail-1.3.2 → commentail-1.4.0}/commentail/admin_settings.py +0 -0
  67. {commentail-1.3.2 → commentail-1.4.0}/commentail/admin_urls.py +0 -0
  68. {commentail-1.3.2 → commentail-1.4.0}/commentail/admin_views.py +0 -0
  69. {commentail-1.3.2 → commentail-1.4.0}/commentail/antispam.py +0 -0
  70. {commentail-1.3.2 → commentail-1.4.0}/commentail/apps.py +0 -0
  71. {commentail-1.3.2 → commentail-1.4.0}/commentail/assets.py +0 -0
  72. {commentail-1.3.2 → commentail-1.4.0}/commentail/author_access.py +0 -0
  73. {commentail-1.3.2 → commentail-1.4.0}/commentail/avatars.py +0 -0
  74. {commentail-1.3.2 → commentail-1.4.0}/commentail/background.py +0 -0
  75. {commentail-1.3.2 → commentail-1.4.0}/commentail/captcha_providers.py +0 -0
  76. {commentail-1.3.2 → commentail-1.4.0}/commentail/config.py +0 -0
  77. {commentail-1.3.2 → commentail-1.4.0}/commentail/content_checks.py +0 -0
  78. {commentail-1.3.2 → commentail-1.4.0}/commentail/detection.py +0 -0
  79. {commentail-1.3.2 → commentail-1.4.0}/commentail/drafts.py +0 -0
  80. {commentail-1.3.2 → commentail-1.4.0}/commentail/fingerprints.py +0 -0
  81. {commentail-1.3.2 → commentail-1.4.0}/commentail/group_permissions.py +0 -0
  82. {commentail-1.3.2 → commentail-1.4.0}/commentail/limits.py +0 -0
  83. {commentail-1.3.2 → commentail-1.4.0}/commentail/logging.py +0 -0
  84. {commentail-1.3.2 → commentail-1.4.0}/commentail/mail_access.py +0 -0
  85. {commentail-1.3.2 → commentail-1.4.0}/commentail/management/__init__.py +0 -0
  86. {commentail-1.3.2 → commentail-1.4.0}/commentail/management/commands/__init__.py +0 -0
  87. {commentail-1.3.2 → commentail-1.4.0}/commentail/management/commands/process_commentail.py +0 -0
  88. {commentail-1.3.2 → commentail-1.4.0}/commentail/middleware.py +0 -0
  89. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0001_initial.py +0 -0
  90. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0002_sitegrouppermission_hide_sitegrouppermission_view.py +0 -0
  91. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0003_actiontoken_captchachallenge_guestgrant.py +0 -0
  92. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0004_submissionrecord.py +0 -0
  93. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0005_rateevent.py +0 -0
  94. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0006_alter_comment_guest_name_and_more.py +0 -0
  95. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0007_actiontoken_nonce_replysubscription_mailjob.py +0 -0
  96. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0008_mailjob_revision.py +0 -0
  97. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0009_formticket.py +0 -0
  98. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0010_captchachallenge_backend_and_more.py +0 -0
  99. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0011_discussion_content_type_discussion_object_id_and_more.py +0 -0
  100. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0012_formticket_draft.py +0 -0
  101. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0013_sitecommentsettings_email_enabled.py +0 -0
  102. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0014_reading_indexes.py +0 -0
  103. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0015_sitecommentsettings_highlight_staff.py +0 -0
  104. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0016_guest_antispam.py +0 -0
  105. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0017_revision_spam_signals.py +0 -0
  106. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/0018_private_fingerprints.py +0 -0
  107. {commentail-1.3.2 → commentail-1.4.0}/commentail/migrations/__init__.py +0 -0
  108. {commentail-1.3.2 → commentail-1.4.0}/commentail/objects.py +0 -0
  109. {commentail-1.3.2 → commentail-1.4.0}/commentail/page_access.py +0 -0
  110. {commentail-1.3.2 → commentail-1.4.0}/commentail/page_integration.py +0 -0
  111. {commentail-1.3.2 → commentail-1.4.0}/commentail/panels.py +0 -0
  112. {commentail-1.3.2 → commentail-1.4.0}/commentail/permissions.py +0 -0
  113. {commentail-1.3.2 → commentail-1.4.0}/commentail/presentation.py +0 -0
  114. {commentail-1.3.2 → commentail-1.4.0}/commentail/public.py +0 -0
  115. {commentail-1.3.2 → commentail-1.4.0}/commentail/reading.py +0 -0
  116. {commentail-1.3.2 → commentail-1.4.0}/commentail/recent.py +0 -0
  117. {commentail-1.3.2 → commentail-1.4.0}/commentail/security.py +0 -0
  118. {commentail-1.3.2 → commentail-1.4.0}/commentail/signals.py +0 -0
  119. {commentail-1.3.2 → commentail-1.4.0}/commentail/static/commentail/admin.js +0 -0
  120. {commentail-1.3.2 → commentail-1.4.0}/commentail/static/commentail/commentail.css +0 -0
  121. {commentail-1.3.2 → commentail-1.4.0}/commentail/static/commentail/commentail.js +0 -0
  122. {commentail-1.3.2 → commentail-1.4.0}/commentail/structured.py +0 -0
  123. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/action.html +0 -0
  124. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/action_error.html +0 -0
  125. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/base.html +0 -0
  126. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/confirm_delete.html +0 -0
  127. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/detail.html +0 -0
  128. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/field.html +0 -0
  129. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/form.html +0 -0
  130. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/group_permission_row.html +0 -0
  131. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/group_permissions.html +0 -0
  132. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/heading.html +0 -0
  133. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/list.html +0 -0
  134. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/mail.html +0 -0
  135. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/management.html +0 -0
  136. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/objects.html +0 -0
  137. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/page_panel.html +0 -0
  138. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/rules.html +0 -0
  139. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/admin/selection.html +0 -0
  140. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/author.html +0 -0
  141. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/avatar.html +0 -0
  142. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/base.html +0 -0
  143. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/block.html +0 -0
  144. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/captcha.html +0 -0
  145. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/comment.html +0 -0
  146. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/edit-form.html +0 -0
  147. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/base.html +0 -0
  148. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/button.html +0 -0
  149. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/confirm.html +0 -0
  150. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/confirm.txt +0 -0
  151. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/confirm_subject.txt +0 -0
  152. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/edit.html +0 -0
  153. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/edit.txt +0 -0
  154. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/edit_subject.txt +0 -0
  155. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/published.html +0 -0
  156. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/published.txt +0 -0
  157. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/published_subject.txt +0 -0
  158. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/rejected.html +0 -0
  159. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/rejected.txt +0 -0
  160. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/rejected_subject.txt +0 -0
  161. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/reply.html +0 -0
  162. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/reply.txt +0 -0
  163. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/emails/reply_subject.txt +0 -0
  164. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/form.html +0 -0
  165. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/provider-captcha.html +0 -0
  166. {commentail-1.3.2 → commentail-1.4.0}/commentail/templates/commentail/replies.html +0 -0
  167. {commentail-1.3.2 → commentail-1.4.0}/commentail/templatetags/__init__.py +0 -0
  168. {commentail-1.3.2 → commentail-1.4.0}/commentail/templatetags/commentail_admin.py +0 -0
  169. {commentail-1.3.2 → commentail-1.4.0}/commentail/templatetags/commentail_tags.py +0 -0
  170. {commentail-1.3.2 → commentail-1.4.0}/commentail/text.py +0 -0
  171. {commentail-1.3.2 → commentail-1.4.0}/commentail/urls.py +0 -0
  172. {commentail-1.3.2 → commentail-1.4.0}/commentail/validation.py +0 -0
  173. {commentail-1.3.2 → commentail-1.4.0}/commentail/views.py +0 -0
  174. {commentail-1.3.2 → commentail-1.4.0}/commentail/wagtail_hooks.py +0 -0
  175. {commentail-1.3.2 → commentail-1.4.0}/commentail/widget.py +0 -0
  176. {commentail-1.3.2 → commentail-1.4.0}/commentail.egg-info/dependency_links.txt +0 -0
  177. {commentail-1.3.2 → commentail-1.4.0}/commentail.egg-info/requires.txt +0 -0
  178. {commentail-1.3.2 → commentail-1.4.0}/commentail.egg-info/top_level.txt +0 -0
  179. {commentail-1.3.2 → commentail-1.4.0}/docs/assets/commentail-preview.png +0 -0
  180. {commentail-1.3.2 → commentail-1.4.0}/docs/assets/support-qr.png +0 -0
  181. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/0.1.0.md +0 -0
  182. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/0.1.1.md +0 -0
  183. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/0.2.0.md +0 -0
  184. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/1.0.0.md +0 -0
  185. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/1.1.0.md +0 -0
  186. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/1.2.0.md +0 -0
  187. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/1.3.0.md +0 -0
  188. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/1.3.1.md +0 -0
  189. {commentail-1.3.2 → commentail-1.4.0}/docs/releases/1.3.2.md +0 -0
  190. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Callbacks.md +0 -0
  191. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Deployment.md +0 -0
  192. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Example-and-testing.md +0 -0
  193. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Installation.md +0 -0
  194. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Object-adapters.md +0 -0
  195. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Performance.md +0 -0
  196. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Recent-comments.md +0 -0
  197. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-0.1.0.md +0 -0
  198. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-0.1.1.md +0 -0
  199. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-0.2.0.md +0 -0
  200. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-1.0.0.md +0 -0
  201. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-1.1.0.md +0 -0
  202. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-1.2.0.md +0 -0
  203. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-1.3.0.md +0 -0
  204. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-1.3.1.md +0 -0
  205. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Release-1.3.2.md +0 -0
  206. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Replies-and-editing.md +0 -0
  207. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Security-and-privacy.md +0 -0
  208. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Structured-data.md +0 -0
  209. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Styling.md +0 -0
  210. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Support.md +0 -0
  211. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Template-contract.md +0 -0
  212. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/Templates.md +0 -0
  213. {commentail-1.3.2 → commentail-1.4.0}/docs/wiki/_Footer.md +0 -0
  214. {commentail-1.3.2 → commentail-1.4.0}/example/README.md +0 -0
  215. {commentail-1.3.2 → commentail-1.4.0}/example/demo/__init__.py +0 -0
  216. {commentail-1.3.2 → commentail-1.4.0}/example/demo/settings.py +0 -0
  217. {commentail-1.3.2 → commentail-1.4.0}/example/demo/urls.py +0 -0
  218. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/__init__.py +0 -0
  219. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/comments.py +0 -0
  220. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/management/__init__.py +0 -0
  221. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/management/commands/__init__.py +0 -0
  222. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/management/commands/bootstrap_demo.py +0 -0
  223. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/migrations/0001_initial.py +0 -0
  224. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/migrations/0002_product.py +0 -0
  225. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/migrations/__init__.py +0 -0
  226. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/models.py +0 -0
  227. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/templates/demo_home/home_page.html +0 -0
  228. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/templates/demo_home/product.html +0 -0
  229. {commentail-1.3.2 → commentail-1.4.0}/example/demo_home/views.py +0 -0
  230. {commentail-1.3.2 → commentail-1.4.0}/example/manage.py +0 -0
  231. {commentail-1.3.2 → commentail-1.4.0}/requirements-test-common.txt +0 -0
  232. {commentail-1.3.2 → commentail-1.4.0}/requirements-test.txt +0 -0
  233. {commentail-1.3.2 → commentail-1.4.0}/setup.cfg +0 -0
  234. {commentail-1.3.2 → commentail-1.4.0}/tests/__init__.py +0 -0
  235. {commentail-1.3.2 → commentail-1.4.0}/tests/settings.py +0 -0
  236. {commentail-1.3.2 → commentail-1.4.0}/tests/targets/__init__.py +0 -0
  237. {commentail-1.3.2 → commentail-1.4.0}/tests/targets/apps.py +0 -0
  238. {commentail-1.3.2 → commentail-1.4.0}/tests/targets/migrations/0001_initial.py +0 -0
  239. {commentail-1.3.2 → commentail-1.4.0}/tests/targets/migrations/__init__.py +0 -0
  240. {commentail-1.3.2 → commentail-1.4.0}/tests/targets/models.py +0 -0
  241. {commentail-1.3.2 → commentail-1.4.0}/tests/templates/wagtailcore/page.html +0 -0
  242. {commentail-1.3.2 → commentail-1.4.0}/tests/test_actions.py +0 -0
  243. {commentail-1.3.2 → commentail-1.4.0}/tests/test_admin.js +0 -0
  244. {commentail-1.3.2 → commentail-1.4.0}/tests/test_admin_ui.py +0 -0
  245. {commentail-1.3.2 → commentail-1.4.0}/tests/test_admission.py +0 -0
  246. {commentail-1.3.2 → commentail-1.4.0}/tests/test_antispam.py +0 -0
  247. {commentail-1.3.2 → commentail-1.4.0}/tests/test_avatars.py +0 -0
  248. {commentail-1.3.2 → commentail-1.4.0}/tests/test_background.py +0 -0
  249. {commentail-1.3.2 → commentail-1.4.0}/tests/test_capability_access.py +0 -0
  250. {commentail-1.3.2 → commentail-1.4.0}/tests/test_captcha_backend.py +0 -0
  251. {commentail-1.3.2 → commentail-1.4.0}/tests/test_captcha_providers.py +0 -0
  252. {commentail-1.3.2 → commentail-1.4.0}/tests/test_cleanup.py +0 -0
  253. {commentail-1.3.2 → commentail-1.4.0}/tests/test_concurrency.py +0 -0
  254. {commentail-1.3.2 → commentail-1.4.0}/tests/test_detection.py +0 -0
  255. {commentail-1.3.2 → commentail-1.4.0}/tests/test_email_backends.py +0 -0
  256. {commentail-1.3.2 → commentail-1.4.0}/tests/test_email_presentation.py +0 -0
  257. {commentail-1.3.2 → commentail-1.4.0}/tests/test_extension_contracts.py +0 -0
  258. {commentail-1.3.2 → commentail-1.4.0}/tests/test_fingerprints.py +0 -0
  259. {commentail-1.3.2 → commentail-1.4.0}/tests/test_form_issuance_limits.py +0 -0
  260. {commentail-1.3.2 → commentail-1.4.0}/tests/test_group_panel.py +0 -0
  261. {commentail-1.3.2 → commentail-1.4.0}/tests/test_inline_edit.py +0 -0
  262. {commentail-1.3.2 → commentail-1.4.0}/tests/test_input_boundaries.py +0 -0
  263. {commentail-1.3.2 → commentail-1.4.0}/tests/test_localization.py +0 -0
  264. {commentail-1.3.2 → commentail-1.4.0}/tests/test_mail_admin.py +0 -0
  265. {commentail-1.3.2 → commentail-1.4.0}/tests/test_name_limit.js +0 -0
  266. {commentail-1.3.2 → commentail-1.4.0}/tests/test_notifications.py +0 -0
  267. {commentail-1.3.2 → commentail-1.4.0}/tests/test_object_adapters.py +0 -0
  268. {commentail-1.3.2 → commentail-1.4.0}/tests/test_outbox.py +0 -0
  269. {commentail-1.3.2 → commentail-1.4.0}/tests/test_performance.py +0 -0
  270. {commentail-1.3.2 → commentail-1.4.0}/tests/test_presentation_contracts.py +0 -0
  271. {commentail-1.3.2 → commentail-1.4.0}/tests/test_progressive.js +0 -0
  272. {commentail-1.3.2 → commentail-1.4.0}/tests/test_provider_widgets.js +0 -0
  273. {commentail-1.3.2 → commentail-1.4.0}/tests/test_public_ui.py +0 -0
  274. {commentail-1.3.2 → commentail-1.4.0}/tests/test_rate_limits.py +0 -0
  275. {commentail-1.3.2 → commentail-1.4.0}/tests/test_reading_contracts.py +0 -0
  276. {commentail-1.3.2 → commentail-1.4.0}/tests/test_recent_comments.py +0 -0
  277. {commentail-1.3.2 → commentail-1.4.0}/tests/test_registry_diagnostics.py +0 -0
  278. {commentail-1.3.2 → commentail-1.4.0}/tests/test_release_gaps.py +0 -0
  279. {commentail-1.3.2 → commentail-1.4.0}/tests/test_reply.js +0 -0
  280. {commentail-1.3.2 → commentail-1.4.0}/tests/test_security.py +0 -0
  281. {commentail-1.3.2 → commentail-1.4.0}/tests/test_security_boundaries.py +0 -0
  282. {commentail-1.3.2 → commentail-1.4.0}/tests/test_smtp_chain.py +0 -0
  283. {commentail-1.3.2 → commentail-1.4.0}/tests/test_staff_authors.py +0 -0
  284. {commentail-1.3.2 → commentail-1.4.0}/tests/test_structured_data.py +0 -0
  285. {commentail-1.3.2 → commentail-1.4.0}/tests/test_submission.py +0 -0
  286. {commentail-1.3.2 → commentail-1.4.0}/tests/test_transaction_contracts.py +0 -0
  287. {commentail-1.3.2 → commentail-1.4.0}/tests/test_translated_site_roots.py +0 -0
  288. {commentail-1.3.2 → commentail-1.4.0}/tests/urls.py +0 -0
  289. {commentail-1.3.2 → commentail-1.4.0}/tests/urls_custom_prefix.py +0 -0
  290. {commentail-1.3.2 → commentail-1.4.0}/tools/benchmark_performance.py +0 -0
  291. {commentail-1.3.2 → commentail-1.4.0}/tools/check_dist.py +0 -0
  292. {commentail-1.3.2 → commentail-1.4.0}/tools/check_translations.py +0 -0
@@ -3,6 +3,29 @@
3
3
  Each release records changes relative to the previous version. Upgrade notes
4
4
  describe changes that an existing installation needs to review.
5
5
 
6
+ ## [1.4.0] — Unreleased · Independent email and early rule rejection
7
+
8
+ - Add project-wide `COMMENTAIL_EMAIL` settings for an independent Django email
9
+ backend, constructor options and sender while preserving shared Django mail
10
+ when no override is configured. Validate configuration without constructing
11
+ or contacting the transport; keep provider response text out of queue errors.
12
+ - Preserve the existing outbox, retries, leases, access checks and SMTP timeout
13
+ limits. Pending jobs use the active configuration at processing time; explicit
14
+ transport failures never fall back to the shared backend.
15
+ - Add English/Russian setup and upgrade guidance with separate SMTP and optional
16
+ API-provider examples. No new dependency.
17
+ - Add `test_commentail_email --to` for direct transport verification without
18
+ comments or queue jobs, with redacted errors and explicit delivery limits.
19
+ - Refuse new guest text matching enabled Reject rules in Apply rules mode before
20
+ creating confirmation mail. Preserve private drafts, CAPTCHA and attempt limits.
21
+ - Add optional 2000-character rule reasons, lowest-ID reason priority and a
22
+ localized fallback; apply schema migration `0019_moderation_rule_reason`.
23
+ - Export CSV reasons and accept the optional column on import. Legacy files
24
+ preserve existing reasons; an explicitly empty cell clears one.
25
+
26
+ This is an unpublished candidate. See [1.4.0 review and upgrade notes](docs/releases/1.4.0.md)
27
+ ([на русском](docs/releases/1.4.0.ru.md)).
28
+
6
29
  ## [1.3.2] — 2026-10-23 · Translated Site roots
7
30
 
8
31
  - Restore Page discussions under translated Site homepages when Wagtail content
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commentail
3
- Version: 1.3.2
3
+ Version: 1.4.0
4
4
  Summary: Self-hosted Wagtail comments with moderation, verified guests and threaded replies
5
5
  License-Expression: MIT
6
6
  Project-URL: Source, https://github.com/hardcodd/Commentail
@@ -41,12 +41,19 @@ There is no new migration over 1.3.1. Upgrading from 1.3.0 or earlier includes
41
41
  the [irreversible 1.3.1 fingerprint migration](docs/releases/1.3.1.md);
42
42
  review its backup, downtime and form-quota guidance first.
43
43
 
44
+ **In this checkout: 1.4.0 candidate, not published.**
45
+ [Separate email configuration](docs/wiki/Email-configuration.md) adds an optional
46
+ Commentail backend, connection options and sender without changing ordinary
47
+ Django mail. The candidate also adds a test-mail command and early guest rejection
48
+ by hard rules, with optional reasons and legacy-compatible CSV import. Apply
49
+ migration `0019`; see the [candidate scope and upgrade notes](docs/releases/1.4.0.md).
50
+
44
51
  [![Tests and distributions](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
45
52
  [![Django Packages · Commentail](https://img.shields.io/badge/Django%20Packages-Commentail-0C4B33.svg)](https://djangopackages.org/packages/p/commentail/)
46
53
 
47
54
  English · [Русский](README.ru.md)
48
55
 
49
- [Get started](#quick-start) · [Screenshots](#screenshots) · [Documentation](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md) · [Wiki](https://github.com/hardcodd/Commentail/wiki) · [Support](#support-commentail)
56
+ [Get started](#quick-start) · [Course](https://hardcodd.net/en/blog/?series=commentail-tutorials) · [Screenshots](#screenshots) · [Documentation](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md) · [Wiki](https://github.com/hardcodd/Commentail/wiki) · [Support](#support-commentail)
50
57
 
51
58
  <img src="https://raw.githubusercontent.com/hardcodd/Commentail/main/docs/assets/commentail-preview.png" alt="Commentail — a blue bird perched on a comment bubble" width="100%">
52
59
 
@@ -226,6 +233,9 @@ The command sends queued mail and removes expired temporary records. Guests conf
226
233
  their email before moderation. Authors with email are subscribed to direct-reply
227
234
  notifications when mail is enabled; every reply email includes per-comment unsubscribe.
228
235
 
236
+ The 1.4.0 candidate refuses matching hard-rule guest submissions before email
237
+ proof, preserving the draft. See [rules and CSV](docs/wiki/Rules-and-CSV.md).
238
+
229
239
  You can configure an API-based Django backend and schedule
230
240
  `commentail.background.process_pending()` in your project's queue instead of a
231
241
  separate command job. Choose one schedule. Backend acceptance does not prove inbox
@@ -275,6 +285,10 @@ settings use a single `COMMENTAIL` dictionary with `default` and hostname overri
275
285
 
276
286
  ## Documentation by task
277
287
 
288
+ The [22-lesson Commentail course](https://hardcodd.net/en/blog/?series=commentail-tutorials)
289
+ walks through installation, email delivery, CAPTCHA, customization and production setup
290
+ with step-by-step examples.
291
+
278
292
  The [Wiki](https://github.com/hardcodd/Commentail/wiki) and the [versioned guides](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md)
279
293
  cover the same topics. Start with the task you need:
280
294
 
@@ -13,12 +13,19 @@ There is no new migration over 1.3.1. Upgrading from 1.3.0 or earlier includes
13
13
  the [irreversible 1.3.1 fingerprint migration](docs/releases/1.3.1.md);
14
14
  review its backup, downtime and form-quota guidance first.
15
15
 
16
+ **In this checkout: 1.4.0 candidate, not published.**
17
+ [Separate email configuration](docs/wiki/Email-configuration.md) adds an optional
18
+ Commentail backend, connection options and sender without changing ordinary
19
+ Django mail. The candidate also adds a test-mail command and early guest rejection
20
+ by hard rules, with optional reasons and legacy-compatible CSV import. Apply
21
+ migration `0019`; see the [candidate scope and upgrade notes](docs/releases/1.4.0.md).
22
+
16
23
  [![Tests and distributions](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
17
24
  [![Django Packages · Commentail](https://img.shields.io/badge/Django%20Packages-Commentail-0C4B33.svg)](https://djangopackages.org/packages/p/commentail/)
18
25
 
19
26
  English · [Русский](README.ru.md)
20
27
 
21
- [Get started](#quick-start) · [Screenshots](#screenshots) · [Documentation](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md) · [Wiki](https://github.com/hardcodd/Commentail/wiki) · [Support](#support-commentail)
28
+ [Get started](#quick-start) · [Course](https://hardcodd.net/en/blog/?series=commentail-tutorials) · [Screenshots](#screenshots) · [Documentation](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md) · [Wiki](https://github.com/hardcodd/Commentail/wiki) · [Support](#support-commentail)
22
29
 
23
30
  <img src="https://raw.githubusercontent.com/hardcodd/Commentail/main/docs/assets/commentail-preview.png" alt="Commentail — a blue bird perched on a comment bubble" width="100%">
24
31
 
@@ -198,6 +205,9 @@ The command sends queued mail and removes expired temporary records. Guests conf
198
205
  their email before moderation. Authors with email are subscribed to direct-reply
199
206
  notifications when mail is enabled; every reply email includes per-comment unsubscribe.
200
207
 
208
+ The 1.4.0 candidate refuses matching hard-rule guest submissions before email
209
+ proof, preserving the draft. See [rules and CSV](docs/wiki/Rules-and-CSV.md).
210
+
201
211
  You can configure an API-based Django backend and schedule
202
212
  `commentail.background.process_pending()` in your project's queue instead of a
203
213
  separate command job. Choose one schedule. Backend acceptance does not prove inbox
@@ -247,6 +257,10 @@ settings use a single `COMMENTAIL` dictionary with `default` and hostname overri
247
257
 
248
258
  ## Documentation by task
249
259
 
260
+ The [22-lesson Commentail course](https://hardcodd.net/en/blog/?series=commentail-tutorials)
261
+ walks through installation, email delivery, CAPTCHA, customization and production setup
262
+ with step-by-step examples.
263
+
250
264
  The [Wiki](https://github.com/hardcodd/Commentail/wiki) and the [versioned guides](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md)
251
265
  cover the same topics. Start with the task you need:
252
266
 
@@ -13,12 +13,19 @@
13
13
  включает [необратимую миграцию отпечатков из 1.3.1](docs/releases/1.3.1.md);
14
14
  заранее проверьте рекомендации о резервной копии, остановке записи и лимитах выдачи форм.
15
15
 
16
+ **В этой рабочей копии: кандидат 1.4.0, ещё не опубликован.**
17
+ [Отдельная настройка почты](docs/wiki/Email-configuration-ru.md) позволяет выбрать
18
+ backend, параметры подключения и отправителя Commentail, сохранив обычную почту
19
+ Django. Также добавлены команда проверочного письма и ранний отказ гостю по
20
+ жёстким правилам, с причинами и сохранением совместимости CSV-импорта. Нужна
21
+ миграция `0019`; см. [состав кандидата и обновление](docs/releases/1.4.0.ru.md).
22
+
16
23
  [![Tests and distributions](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/hardcodd/Commentail/actions/workflows/tests.yml)
17
24
  [![Django Packages · Commentail](https://img.shields.io/badge/Django%20Packages-Commentail-0C4B33.svg)](https://djangopackages.org/packages/p/commentail/)
18
25
 
19
26
  [English](README.md) · Русский
20
27
 
21
- [Начать работу](#быстрый-старт) · [Скриншоты](#скриншоты) · [Документация](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md) · [Wiki](https://github.com/hardcodd/Commentail/wiki) · [Поддержать](#поддержать-commentail)
28
+ [Начать работу](#быстрый-старт) · [Курс](https://hardcodd.net/blog/?series=commentail-tutorials) · [Скриншоты](#скриншоты) · [Документация](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home-ru.md) · [Wiki](https://github.com/hardcodd/Commentail/wiki/Home-ru) · [Поддержать](#поддержать-commentail)
22
29
 
23
30
  <img src="https://raw.githubusercontent.com/hardcodd/Commentail/main/docs/assets/commentail-preview.png" alt="Commentail — синяя птица на облачке комментария" width="100%">
24
31
 
@@ -200,6 +207,9 @@ python manage.py process_commentail
200
207
  подтверждают email до модерации. При включённой почте авторы с email подписываются
201
208
  на уведомления о прямых ответах; каждое такое письмо содержит отписку для комментария.
202
209
 
210
+ В кандидате 1.4.0 совпадение с жёстким правилом отклоняет гостевую отправку
211
+ до подтверждения email и сохраняет черновик. См. [правила и CSV](docs/wiki/Rules-and-CSV.md).
212
+
203
213
  Можно настроить почтовый backend Django с доставкой через
204
214
  API и запускать `commentail.background.process_pending()` в очереди проекта
205
215
  вместо отдельной команды по расписанию. Выберите один способ запуска. Принятие
@@ -251,8 +261,12 @@ Django через `OBJECT_ADAPTERS`. Технические настройки
251
261
 
252
262
  ## Документация по задачам
253
263
 
254
- [Wiki](https://github.com/hardcodd/Commentail/wiki) и
255
- [руководства в репозитории](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home.md)
264
+ [Курс по Commentail из 22 уроков](https://hardcodd.net/blog/?series=commentail-tutorials)
265
+ пошагово разбирает установку, отправку писем, CAPTCHA, оформление и подготовку
266
+ рабочего сайта с примерами кода.
267
+
268
+ [Wiki](https://github.com/hardcodd/Commentail/wiki/Home-ru) и
269
+ [руководства в репозитории](https://github.com/hardcodd/Commentail/blob/main/docs/wiki/Home-ru.md)
256
270
  охватывают одни и те же темы. Руководства доступны на английском. Начните с нужной задачи:
257
271
 
258
272
  | Область | Руководства |
@@ -10,16 +10,15 @@ from datetime import timedelta
10
10
 
11
11
  from django.conf import settings
12
12
  from django.contrib.auth.base_user import AbstractBaseUser
13
- from django.core.mail.backends.smtp import EmailBackend
14
13
  from django.db import transaction
15
14
  from django.db.models import F
16
15
  from django.http import HttpRequest
17
16
  from django.utils import timezone
18
- from django.utils.module_loading import import_string
19
17
  from wagtail.models import Site
20
18
 
21
19
  from .antispam import captcha_required, consume_attempt, form_signals, request_signals
22
20
  from .config import technical_settings
21
+ from .email import email_configured
23
22
  from .fingerprints import fingerprint_candidates
24
23
  from .limits import client_ip, consume
25
24
  from .models import Access, Comment, Discussion, FormTicket, Mode, SubmissionRecord
@@ -59,18 +58,6 @@ def can_view(request: HttpRequest, discussion: Discussion) -> bool:
59
58
  )
60
59
 
61
60
 
62
- def email_configured() -> bool:
63
- """Check configuration without constructing or contacting the transport.
64
-
65
- Only SMTP needs an explicit host; other Django backends own their settings.
66
- This is availability for forms, not evidence of successful delivery.
67
- """
68
- backend = import_string(settings.EMAIL_BACKEND)
69
- if issubclass(backend, EmailBackend):
70
- return settings.is_overridden("EMAIL_HOST") and bool(settings.EMAIL_HOST)
71
- return True
72
-
73
-
74
61
  def issue_form(
75
62
  request: HttpRequest,
76
63
  discussion: Discussion,
@@ -0,0 +1,12 @@
1
+ from django.core.checks import Error, register
2
+
3
+ from .config import configuration_errors
4
+ from .email import configuration_errors as email_configuration_errors
5
+
6
+
7
+ @register()
8
+ def check_settings(app_configs: object, **kwargs: object) -> list[Error]:
9
+ return [
10
+ Error(message, id="commentail.E001")
11
+ for message in configuration_errors() + email_configuration_errors()
12
+ ]
@@ -0,0 +1,148 @@
1
+ """Project-wide mail transport configuration, independent of Django's default.
2
+
3
+ Validation and guest-form availability never instantiate a backend. Constructor
4
+ options belong to the selected backend; only SMTP's known options are checked
5
+ here. Credentials and backend exception text must not appear in diagnostics.
6
+ """
7
+
8
+ import math
9
+ from typing import TypedDict
10
+
11
+ from django.conf import settings
12
+ from django.core.exceptions import ImproperlyConfigured
13
+ from django.core.mail import get_connection
14
+ from django.core.mail.backends.base import BaseEmailBackend
15
+ from django.core.mail.backends.smtp import EmailBackend
16
+ from django.utils.module_loading import import_string
17
+
18
+
19
+ class EmailSettings(TypedDict):
20
+ """Resolved transport, constructor options and sender for this process."""
21
+
22
+ BACKEND: str
23
+ OPTIONS: dict[str, object]
24
+ FROM_EMAIL: str
25
+
26
+
27
+ def configuration_errors() -> list[str]:
28
+ """Return redacted configuration errors without constructing a transport."""
29
+ config = getattr(settings, "COMMENTAIL_EMAIL", {})
30
+ if not isinstance(config, dict):
31
+ return ["COMMENTAIL_EMAIL must be a dictionary"]
32
+
33
+ errors: list[str] = []
34
+ if config.keys() - {"BACKEND", "OPTIONS", "FROM_EMAIL"}:
35
+ errors.append("COMMENTAIL_EMAIL accepts only BACKEND, OPTIONS and FROM_EMAIL")
36
+
37
+ backend_path = config.get("BACKEND")
38
+ backend = None
39
+ if backend_path is not None and (
40
+ not isinstance(backend_path, str) or not backend_path.strip()
41
+ ):
42
+ errors.append("COMMENTAIL_EMAIL BACKEND must be a class import path or None")
43
+ else:
44
+ try:
45
+ backend = import_string(backend_path or settings.EMAIL_BACKEND)
46
+ if not isinstance(backend, type) or not issubclass(
47
+ backend, BaseEmailBackend
48
+ ):
49
+ errors.append("COMMENTAIL_EMAIL backend must extend BaseEmailBackend")
50
+ backend = None
51
+ except (ImportError, AttributeError, ValueError):
52
+ errors.append("COMMENTAIL_EMAIL backend cannot be imported")
53
+
54
+ options = config.get("OPTIONS", {})
55
+ if not isinstance(options, dict) or not all(
56
+ isinstance(key, str) for key in options
57
+ ):
58
+ errors.append("COMMENTAIL_EMAIL OPTIONS must be a dictionary with string keys")
59
+ else:
60
+ if {"backend", "fail_silently"} & options.keys():
61
+ errors.append(
62
+ "COMMENTAIL_EMAIL OPTIONS cannot set backend or fail_silently"
63
+ )
64
+ if options and not backend_path:
65
+ errors.append("COMMENTAIL_EMAIL OPTIONS requires an explicit BACKEND")
66
+ if backend is not None and issubclass(backend, EmailBackend):
67
+ errors.extend(_smtp_errors(options))
68
+
69
+ sender = config.get("FROM_EMAIL")
70
+ if sender is not None and (
71
+ not isinstance(sender, str)
72
+ or not sender.strip()
73
+ or any(character in sender for character in ("\r", "\n", "\x00"))
74
+ ):
75
+ errors.append(
76
+ "COMMENTAIL_EMAIL FROM_EMAIL must be a nonempty single-line string or None"
77
+ )
78
+ return errors
79
+
80
+
81
+ def _smtp_errors(options: dict[str, object]) -> list[str]:
82
+ """Check standard SMTP options while allowing subclass-specific keywords."""
83
+ errors: list[str] = []
84
+ for key in ("host", "username", "password", "ssl_keyfile", "ssl_certfile"):
85
+ value = options.get(key)
86
+ if value is not None and not isinstance(value, str):
87
+ errors.append(f"COMMENTAIL_EMAIL SMTP {key} must be a string or None")
88
+ port = options.get("port")
89
+ if port is not None and (type(port) is not int or not 1 <= port <= 65535):
90
+ errors.append("COMMENTAIL_EMAIL SMTP port must be an integer from 1 to 65535")
91
+ for key in ("use_tls", "use_ssl"):
92
+ if options.get(key) is not None and type(options[key]) is not bool:
93
+ errors.append(f"COMMENTAIL_EMAIL SMTP {key} must be a boolean or None")
94
+ tls = options.get("use_tls")
95
+ ssl = options.get("use_ssl")
96
+ if (settings.EMAIL_USE_TLS if tls is None else tls) and (
97
+ settings.EMAIL_USE_SSL if ssl is None else ssl
98
+ ):
99
+ errors.append(
100
+ "COMMENTAIL_EMAIL SMTP use_tls and use_ssl cannot both be enabled"
101
+ )
102
+ timeout = options.get("timeout")
103
+ if timeout is not None and (
104
+ type(timeout) not in (int, float)
105
+ or (type(timeout) is float and not math.isfinite(timeout))
106
+ or timeout <= 0
107
+ ):
108
+ errors.append(
109
+ "COMMENTAIL_EMAIL SMTP timeout must be finite and positive or None"
110
+ )
111
+ return errors
112
+
113
+
114
+ def email_settings() -> EmailSettings:
115
+ """Resolve current settings; invalid independent configuration never falls back."""
116
+ errors = configuration_errors()
117
+ if errors:
118
+ raise ImproperlyConfigured("; ".join(errors))
119
+ config = getattr(settings, "COMMENTAIL_EMAIL", {})
120
+ return {
121
+ "BACKEND": config.get("BACKEND") or settings.EMAIL_BACKEND,
122
+ "OPTIONS": dict(config.get("OPTIONS", {})),
123
+ "FROM_EMAIL": config.get("FROM_EMAIL") or settings.DEFAULT_FROM_EMAIL,
124
+ }
125
+
126
+
127
+ def email_configured() -> bool:
128
+ """Check form availability without I/O; SMTP requires an explicit host."""
129
+ config = email_settings()
130
+ backend = import_string(config["BACKEND"])
131
+ if issubclass(backend, EmailBackend):
132
+ host = config["OPTIONS"].get("host")
133
+ if isinstance(host, str):
134
+ return bool(host.strip())
135
+ return settings.is_overridden("EMAIL_HOST") and bool(settings.EMAIL_HOST)
136
+ return True
137
+
138
+
139
+ def connection() -> BaseEmailBackend:
140
+ """Construct the current backend with failures enabled for queue retry handling."""
141
+ config = email_settings()
142
+ backend = import_string(config["BACKEND"])
143
+ host = config["OPTIONS"].get("host")
144
+ if issubclass(backend, EmailBackend) and isinstance(host, str) and not host.strip():
145
+ # Django treats an empty host kwarg as inheritance. Here it explicitly
146
+ # disables SMTP, including existing jobs, rather than rerouting mail.
147
+ raise ImproperlyConfigured("COMMENTAIL_EMAIL SMTP host is empty")
148
+ return get_connection(config["BACKEND"], fail_silently=False, **config["OPTIONS"])
@@ -90,11 +90,20 @@ class DiscussionSettingsForm(forms.ModelForm):
90
90
  class RuleForm(forms.ModelForm):
91
91
  class Meta:
92
92
  model = ModerationRule
93
- fields = ("phrase", "action", "enabled")
93
+ fields = ("phrase", "action", "enabled", "reason")
94
94
  labels: ClassVar[dict[str, object]] = {
95
95
  "phrase": _("Word or phrase"),
96
96
  "action": _("Action"),
97
97
  "enabled": _("Enabled"),
98
+ "reason": _("Rejection reason"),
99
+ }
100
+ help_texts: ClassVar[dict[str, object]] = {
101
+ "reason": _(
102
+ "Shown to guests when a Reject rule blocks submission before email confirmation. Leave blank for the default message."
103
+ ),
104
+ }
105
+ widgets: ClassVar[dict[str, forms.Widget]] = {
106
+ "reason": forms.Textarea(attrs={"rows": 3}),
98
107
  }
99
108
 
100
109
 
@@ -1063,3 +1063,27 @@ msgstr "Prüfung wiederholen"
1063
1063
 
1064
1064
  msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
1065
  msgstr "Zu viele Formularanfragen. Bitte warten Sie und versuchen Sie die Prüfung erneut. Ihr Entwurf bleibt erhalten."
1066
+
1067
+ msgid "Rejection reason"
1068
+ msgstr "Ablehnungsgrund"
1069
+
1070
+ msgid "Shown to guests when a Reject rule blocks submission before email confirmation. Leave blank for the default message."
1071
+ msgstr "Wird Gästen angezeigt, wenn eine Ablehnungsregel das Absenden vor der E-Mail-Bestätigung verhindert. Für die Standardmeldung leer lassen."
1072
+
1073
+ msgid "Text does not comply with the discussion rules."
1074
+ msgstr "Der Text entspricht nicht den Diskussionsregeln."
1075
+
1076
+ msgid "CSV headers must be phrase, action, enabled, with optional reason."
1077
+ msgstr "Die CSV-Spalten müssen phrase, action, enabled und optional reason heißen."
1078
+
1079
+ msgid "Row %(line)s: expected %(columns)s columns."
1080
+ msgstr "Zeile %(line)s: %(columns)s Spalten erwartet."
1081
+
1082
+ msgid "Row %(line)s: reason must contain at most 2000 characters without null bytes."
1083
+ msgstr "Zeile %(line)s: Der Grund darf höchstens 2000 Zeichen und keine Nullbytes enthalten."
1084
+
1085
+ msgid "The optional reason column sets the guest rejection message (up to 2000 characters). Without this column, existing reasons are preserved; an empty cell clears the reason."
1086
+ msgstr "Die optionale Spalte reason legt die Ablehnungsnachricht für Gäste fest (bis zu 2000 Zeichen). Ohne diese Spalte bleiben vorhandene Gründe erhalten; eine leere Zelle löscht den Grund."
1087
+
1088
+ msgid "The same spreadsheet escaping applies to rejection reasons."
1089
+ msgstr "Dieselbe Maskierung für Tabellenkalkulationen gilt auch für Ablehnungsgründe."
@@ -1063,3 +1063,27 @@ msgstr "Reintentar la verificación"
1063
1063
 
1064
1064
  msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
1065
  msgstr "Demasiadas solicitudes de formulario. Espera y vuelve a intentar la verificación. Tu borrador se conserva."
1066
+
1067
+ msgid "Rejection reason"
1068
+ msgstr "Motivo del rechazo"
1069
+
1070
+ msgid "Shown to guests when a Reject rule blocks submission before email confirmation. Leave blank for the default message."
1071
+ msgstr "Se muestra a los invitados cuando una regla de rechazo bloquea el envío antes de confirmar el correo. Déjelo vacío para usar el mensaje predeterminado."
1072
+
1073
+ msgid "Text does not comply with the discussion rules."
1074
+ msgstr "El texto no cumple las normas de la discusión."
1075
+
1076
+ msgid "CSV headers must be phrase, action, enabled, with optional reason."
1077
+ msgstr "Las cabeceras CSV deben ser phrase, action, enabled y, opcionalmente, reason."
1078
+
1079
+ msgid "Row %(line)s: expected %(columns)s columns."
1080
+ msgstr "Fila %(line)s: se esperaban %(columns)s columnas."
1081
+
1082
+ msgid "Row %(line)s: reason must contain at most 2000 characters without null bytes."
1083
+ msgstr "Fila %(line)s: el motivo debe tener como máximo 2000 caracteres y no contener bytes nulos."
1084
+
1085
+ msgid "The optional reason column sets the guest rejection message (up to 2000 characters). Without this column, existing reasons are preserved; an empty cell clears the reason."
1086
+ msgstr "La columna opcional reason establece el mensaje de rechazo para invitados (hasta 2000 caracteres). Sin esta columna se conservan los motivos existentes; una celda vacía borra el motivo."
1087
+
1088
+ msgid "The same spreadsheet escaping applies to rejection reasons."
1089
+ msgstr "El mismo escape para hojas de cálculo se aplica a los motivos de rechazo."
@@ -1063,3 +1063,27 @@ msgstr "Réessayer la vérification"
1063
1063
 
1064
1064
  msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
1065
  msgstr "Trop de demandes de formulaire. Veuillez patienter et réessayer la vérification. Votre brouillon est conservé."
1066
+
1067
+ msgid "Rejection reason"
1068
+ msgstr "Motif du refus"
1069
+
1070
+ msgid "Shown to guests when a Reject rule blocks submission before email confirmation. Leave blank for the default message."
1071
+ msgstr "Affiché aux visiteurs lorsqu’une règle de refus bloque l’envoi avant la confirmation de l’adresse e-mail. Laisser vide pour le message par défaut."
1072
+
1073
+ msgid "Text does not comply with the discussion rules."
1074
+ msgstr "Le texte ne respecte pas les règles de la discussion."
1075
+
1076
+ msgid "CSV headers must be phrase, action, enabled, with optional reason."
1077
+ msgstr "Les en-têtes CSV doivent être phrase, action, enabled et, éventuellement, reason."
1078
+
1079
+ msgid "Row %(line)s: expected %(columns)s columns."
1080
+ msgstr "Ligne %(line)s : %(columns)s colonnes attendues."
1081
+
1082
+ msgid "Row %(line)s: reason must contain at most 2000 characters without null bytes."
1083
+ msgstr "Ligne %(line)s : le motif doit contenir au plus 2000 caractères, sans octets nuls."
1084
+
1085
+ msgid "The optional reason column sets the guest rejection message (up to 2000 characters). Without this column, existing reasons are preserved; an empty cell clears the reason."
1086
+ msgstr "La colonne facultative reason définit le message de refus pour les visiteurs (2000 caractères maximum). Sans cette colonne, les motifs existants sont conservés ; une cellule vide efface le motif."
1087
+
1088
+ msgid "The same spreadsheet escaping applies to rejection reasons."
1089
+ msgstr "Le même échappement pour les tableurs s’applique aux motifs de refus."
@@ -1063,3 +1063,27 @@ msgstr "Tentar verificação novamente"
1063
1063
 
1064
1064
  msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
1065
  msgstr "Muitas solicitações de formulário. Aguarde e tente a verificação novamente. Seu rascunho foi mantido."
1066
+
1067
+ msgid "Rejection reason"
1068
+ msgstr "Motivo da rejeição"
1069
+
1070
+ msgid "Shown to guests when a Reject rule blocks submission before email confirmation. Leave blank for the default message."
1071
+ msgstr "Exibido aos visitantes quando uma regra de rejeição bloqueia o envio antes da confirmação do e-mail. Deixe em branco para usar a mensagem padrão."
1072
+
1073
+ msgid "Text does not comply with the discussion rules."
1074
+ msgstr "O texto não segue as regras da discussão."
1075
+
1076
+ msgid "CSV headers must be phrase, action, enabled, with optional reason."
1077
+ msgstr "Os cabeçalhos CSV devem ser phrase, action, enabled e, opcionalmente, reason."
1078
+
1079
+ msgid "Row %(line)s: expected %(columns)s columns."
1080
+ msgstr "Linha %(line)s: esperadas %(columns)s colunas."
1081
+
1082
+ msgid "Row %(line)s: reason must contain at most 2000 characters without null bytes."
1083
+ msgstr "Linha %(line)s: o motivo deve conter no máximo 2000 caracteres, sem bytes nulos."
1084
+
1085
+ msgid "The optional reason column sets the guest rejection message (up to 2000 characters). Without this column, existing reasons are preserved; an empty cell clears the reason."
1086
+ msgstr "A coluna opcional reason define a mensagem de rejeição para visitantes (até 2000 caracteres). Sem essa coluna, os motivos existentes são preservados; uma célula vazia apaga o motivo."
1087
+
1088
+ msgid "The same spreadsheet escaping applies to rejection reasons."
1089
+ msgstr "O mesmo escape para planilhas se aplica aos motivos de rejeição."
@@ -1063,3 +1063,27 @@ msgstr "Повторить проверку"
1063
1063
 
1064
1064
  msgid "Too many form requests. Please wait and retry the check. Your draft is kept."
1065
1065
  msgstr "Слишком много запросов формы. Подождите и повторите проверку. Ваш черновик сохранён."
1066
+
1067
+ msgid "Rejection reason"
1068
+ msgstr "Причина отклонения"
1069
+
1070
+ msgid "Shown to guests when a Reject rule blocks submission before email confirmation. Leave blank for the default message."
1071
+ msgstr "Показывается гостю, если правило «Отклонить» блокирует отправку до подтверждения email. Оставьте пустым для стандартного сообщения."
1072
+
1073
+ msgid "Text does not comply with the discussion rules."
1074
+ msgstr "Текст не соответствует правилам обсуждения."
1075
+
1076
+ msgid "CSV headers must be phrase, action, enabled, with optional reason."
1077
+ msgstr "Заголовки CSV: phrase, action, enabled; необязательная колонка — reason."
1078
+
1079
+ msgid "Row %(line)s: expected %(columns)s columns."
1080
+ msgstr "Строка %(line)s: ожидается колонок — %(columns)s."
1081
+
1082
+ msgid "Row %(line)s: reason must contain at most 2000 characters without null bytes."
1083
+ msgstr "Строка %(line)s: причина должна содержать не более 2000 символов без нулевых байтов."
1084
+
1085
+ msgid "The optional reason column sets the guest rejection message (up to 2000 characters). Without this column, existing reasons are preserved; an empty cell clears the reason."
1086
+ msgstr "Необязательная колонка reason задаёт причину отказа для гостя (до 2000 символов). Без этой колонки существующие причины сохраняются; пустая ячейка очищает причину."
1087
+
1088
+ msgid "The same spreadsheet escaping applies to rejection reasons."
1089
+ msgstr "Причины отклонения экранируются для электронных таблиц тем же способом."
@@ -0,0 +1,57 @@
1
+ """Send a transport probe without touching comments, tokens or queued jobs."""
2
+
3
+ from argparse import ArgumentParser
4
+ from typing import ClassVar
5
+
6
+ from django.core.exceptions import ValidationError
7
+ from django.core.mail import EmailMessage
8
+ from django.core.mail.backends.smtp import EmailBackend
9
+ from django.core.management.base import BaseCommand, CommandError
10
+ from django.core.validators import validate_email
11
+
12
+ from commentail.email import connection, email_settings
13
+
14
+
15
+ class Command(BaseCommand):
16
+ help = "Send one test email using Commentail's configured backend and sender."
17
+ # The probe needs no database or unrelated application checks. Its transport
18
+ # configuration is validated by email_settings before any network access.
19
+ requires_system_checks: ClassVar[list[str]] = []
20
+
21
+ def add_arguments(self, parser: ArgumentParser) -> None:
22
+ parser.add_argument("--to", required=True, help="One explicit test recipient.")
23
+
24
+ def handle(self, *args: object, **options: object) -> None:
25
+ recipient = options.get("to")
26
+ try:
27
+ validate_email(recipient)
28
+ except (ValidationError, TypeError):
29
+ raise CommandError("Provide one valid email address with --to.") from None
30
+
31
+ try:
32
+ config = email_settings()
33
+ backend = connection()
34
+ if isinstance(backend, EmailBackend):
35
+ backend.timeout = (
36
+ 30 if backend.timeout is None else min(30, backend.timeout)
37
+ )
38
+ with backend:
39
+ message = EmailMessage(
40
+ "Commentail test email",
41
+ "This is a test of the email backend and sender configured for Commentail.\n"
42
+ "No comment or subscription was created.\n",
43
+ config["FROM_EMAIL"],
44
+ [recipient],
45
+ connection=backend,
46
+ )
47
+ accepted = message.send()
48
+ except Exception as exc: # noqa: BLE001 -- redact arbitrary provider failures
49
+ # Arbitrary providers may include credentials in exceptions. Keep
50
+ # only the class, including when Django is run with --traceback.
51
+ raise CommandError(f"Test email failed ({type(exc).__name__}).") from None
52
+
53
+ if accepted != 1:
54
+ raise CommandError("The backend did not accept the test email.")
55
+ self.stdout.write(
56
+ "The backend accepted one test email. This does not confirm inbox delivery."
57
+ )
@@ -0,0 +1,20 @@
1
+ """Add optional sender-facing reasons without changing existing rule choices."""
2
+
3
+ from typing import ClassVar
4
+
5
+ from django.db import migrations, models
6
+ from django.db.migrations.operations.base import Operation
7
+
8
+
9
+ class Migration(migrations.Migration):
10
+ dependencies: ClassVar[list[tuple[str, str]]] = [
11
+ ("commentail", "0018_private_fingerprints"),
12
+ ]
13
+
14
+ operations: ClassVar[list[Operation]] = [
15
+ migrations.AddField(
16
+ model_name="moderationrule",
17
+ name="reason",
18
+ field=models.TextField(blank=True, max_length=2000),
19
+ ),
20
+ ]
@@ -229,6 +229,7 @@ class ModerationRule(models.Model):
229
229
  phrase = models.CharField(max_length=255)
230
230
  action = models.CharField(max_length=10, choices=Action.choices)
231
231
  enabled = models.BooleanField(default=True)
232
+ reason = models.TextField(blank=True, max_length=2000)
232
233
 
233
234
 
234
235
  class SiteGroupPermission(models.Model):