Mirroring a read-only mailing list in Discourse

:bookmark: This guide explains how to create a read-only mirror of a mailing list using Discourse. It covers the necessary site settings, category configuration, and subscription process.

:person_raising_hand: Required user level: Administrator

Discourse can function as an archive for a mailing list while allowing registered users to utilize most of its features. This guide will walk you through the process of setting up your own mailing list mirror.

:eyes: See this in our action on the Ruby-Talk mailing list mirror.

Summary

  • Configure site settings for email handling
  • Create or modify a category for the mailing list
  • Subscribe to the mailing list
  • Understand how the mirroring process works

The following guide uses two email addresses as placeholders. You need to replace them with your actual addresses.

discourse@example.com is address for incoming emails on your Discourse
mailing-list@foo.test is the submission address of the mailing list[1]

Configuring site settings

  1. If you’re not on a hosting plan that pre-configures incoming email, set up POP3 polling or manual polling via API for the account associated with your Discourse email address (e.g., discourse@example.com).

  2. Enable the following site settings:

    • email_in: Allow incoming emails
    • enable_staged_users: Enable staged users (crucial for the mirroring process)
  3. Optional settings:

    • Set authorized_extensions to * or add specific file extensions to allow the attachment types you need
    • Enable always_show_trimmed_content to allow all users to see trimmed content (hidden behind a image button)
    • Enable display_name_on_posts and disable prioritize_username_in_ux for name display preferences

Creating or modifying a category

  1. Create a new category or edit an existing one for the mailing list posts.

  2. Configure category permissions:

    • Click the “Security” tab, then “Edit Permissions”
    • Remove all existing permissions
    • Add “everyone” with “See” permission

When you’re done, it should look like this:

  1. Configure category settings:

    • Click the “Settings” tab
    • Enable “Accept emails from anonymous users with no accounts”
    • Set “Custom incoming email address” to the mailing list’s email address (e.g., mailing-list@foo.test)
    • Enable “Category mirrors mailing list”
  2. Save the category settings.

Subscribing to the mailing list

  1. Subscribe to the mailing list using your Discourse email address (e.g., discourse@example.com).

  2. If the mailing list has a web interface, ensure the following settings:

    • Mail delivery is enabled
    • Digest mode is off
    • Password reminder emails are disabled

For Mailman 2, make sure:

  • “Mail delivery” is “Enabled”
  • “Set Digest Mode” is “Off”
  • “Get password reminder email for this list?” is set to “No”

How it works

Enabling “Category mirrors a mailing list” changes how incoming emails are processed for that specific category:

  • Auto-generated emails are allowed, even when block_auto_generated_emails is enabled
  • All users can post via email, ignoring the email_in_allowed_groups setting
  • Incoming emails use the Message-ID to find related posts, regardless of the find_related_post_with_key setting
  • Markdown interpretation is limited to code blocks enclosed in triple backticks
  • Rejection emails are not sent for mailing list posts

FAQs

Q: Can I mirror multiple mailing lists?
A: Yes, create a separate category for each mailing list and configure them as described above.

Q: Can users reply to notifications and post to the mailing list?
A: No, replies to notifications are sent to Discourse, not the original mailing list. Users cannot post directly to the mailing list through Discourse.

Q: How can I prevent users from posting to the mirrored category via email?
A: While the category allows email posting, you can keep the incoming email address private to prevent unauthorized posting.


  1. i.e. people send to this address to post to the list, and it also appears on the To:/CC: lines of emails sent by the list to members ↩︎

Last edited by @supermathie 2024-10-18T20:01:40Z

Check documentPerform check on document:
31 лайк

Это значит, что «если любой пользователь знает адрес входящей почты, он может публиковать сообщения в этой категории»? Это можно предотвратить, просто не сообщая этот адрес никому, верно?

Но, предположительно, если кто-то получает уведомление по электронной почте, он может ответить. Отправляется ли этот ответ в Discourse как сообщение или в рассылку?

2 лайка

Это хорошие вопросы.

Да, я думаю, это возможно, если они знают адрес входящей почты и подделывают поле From, чтобы оно совпадало с адресом рассылки.

Я хотел бы сказать «нет», но я не на 100% уверен в этом. Так что, возможно. Пожалуйста, попробуйте и дайте мне знать. Возможно, для этого также требуется подделка адреса отправителя.

Он определённо отправляется в Discourse.

3 лайка

У меня есть сайт, на который пересылается группа Google в категорию с включёнными настройками «принимать письма от анонимных отправителей» и «зеркалирует список рассылки», но почта всё равно отклоняется с ошибкой Email::Receiver::UserNotFoundError.

Может быть, есть ещё что-то, что может вызвать это?

2 лайка

Вы включили пользователей в режиме ожидания?

4 лайка

Нет. Функция «Staged users» была отключена. Значит, для её работы она должна быть включена? (Это логично…) Возможно, стоит добавить проверку этого условия при попытке её активировать?

2 лайка

Я не уверен, но это моё лучшее предположение.

РЕДАКТИРОВАНИЕ: есть только одно место, где возникает эта ошибка, и выглядит оно так:

raise UserNotFoundError unless SiteSetting.enable_staged_users

4 лайка

Мне придётся это проверить, но я предполагаю, что довольно много людей будут пытаться ответить. Было бы неплохо иметь одну или несколько из следующих опций:

  1. Не отправлять письма, даже если кто-то следит за этой категорией. Возможно, показывать уведомление (или одноразовое сообщение) с указанием, что если они хотят получать рассылку по электронной почте, им следует {выполнить необходимые шаги для подписки на список напрямую}.

  2. Позволить администратору сайта определять адрес ответа при отправке писем из категории, являющейся зеркалом списка рассылки. (Разумеется, для каждой категории отдельно.) Тогда пользователи смогут подписаться на этот список без получения писем, получать уведомления от Discourse, и если они ответят, этот ответ будет отправлен в оригинальный список.

  3. Опцию «перенаправлять ответы в категорию», при которой при ответе создаётся связанная тема в другой категории. Например, категория «Объявления» является зеркалом списка рассылки, а для ответов — «Обсуждение объявлений». Название ещё нужно доработать. :slight_smile:

3 лайка

Указано ли это в руководстве @gerhard?

3 лайка

Нет, не работало, но теперь работает.

5 лайков

Спасибо! Раньше это меня сбивало с толку, потому что я предполагал, что специальная обработка здесь также как-то по-особому обрабатывает пользователей со статусом «staged» (возможно, только создавая их для постов в этой категории?).

4 лайка

Можно ли сделать это двусторонним, создав аккаунт в Discourse, который будет участником Google Groups? Тогда сообщения с форумов будут отправляться в GG так, как если бы это был просто ещё один пользователь в рассылке (нам нужно будет отклонять всю входящую почту от этого пользователя, чтобы избежать зацикливания). Я задаю этот вопрос как способ запустить Discourse и GG параллельно в период перехода пользователей.

Я успешно настраиваю зеркало рассылки Google Groups, но оно не распознаёт ответы по темам. В результате появляются отдельные сообщения: Google Topic 1 и отдельно Re: Google Topic 1. Можно ли настроить распознавание цепочек сообщений?