以下の手順を試す前に、必ず Discourse のバックアップを取得してください 
以下の手順で、投稿内のすべてのメールアドレスを [email_redacted] に置換できます。正規表現は限定的であり、見落としが生じる可能性がありますが、すべての投稿の内容を修正する際に、私が読み理解できる表現を好みます。
$ ./launcher enter app
/var/www/discourse# su - postgres -c psql
psql (13.2 (Debian 13.2-1.pgdg100+1))
ヘルプを表示するには「help」と入力してください。
postgres=# \c discourse
データベース「discourse」に接続しました。ユーザーは「postgres」です。
discourse=# \set re '[0-9a-z._%+-]+@[a-z0-9.-]+\\.[a-z]{2,64}'
discourse=# update posts set raw = regexp_replace(raw, :'re', '[email_redacted]', 'gi') where raw ~ :'re';
UPDATE 1
discourse=# update posts set cooked = regexp_replace(cooked, :'re', '[email_redacted]', 'gi') where cooked ~ :'re';
UPDATE 1