The Message Rewrite Facility (MRF) is a subsystem that is implemented as a series of hooks that allows the administrator to rewrite or discard messages.
Possible uses include:
marking incoming messages with media from a given account or instance as sensitive
rejecting messages from a specific instance
removing/unlisting messages from the public timelines
removing media from messages
sending only public messages to a specific instance
The MRF provides user-configurable policies. The default policy is NoOpPolicy, which disables the MRF functionality. Pleroma also includes an easy to use policy called SimplePolicy which maps messages matching certain pre-defined criterion to actions built into the policy module.
It is possible to use multiple, active MRF policies at the same time.
You have the ability to prevent from private / followers-only messages from federating with specific instances. Which means they will only get the public or unlisted messages from your instance.
If, for example, you're using MIX_ENV=prod aka using production mode, you would open your configuration file located in config/prod.secret.exs and edit or add the option under your :instance config object. Then you would specify the instance within quotes.
Once SimplePolicy is enabled, you can configure various groups in the :mrf_simple config object. These groups are:
media_removal: Servers in this group will have media stripped from incoming messages.
media_nsfw: Servers in this group will have the #nsfw tag and sensitive setting injected into incoming messages which contain media.
reject: Servers in this group will have their messages rejected.
federated_timeline_removal: Servers in this group will have their messages unlisted from the public timelines by flipping the to and cc fields.
Servers should be configured as lists.
This example will enable SimplePolicy, block media from illegalporn.biz, mark media as NSFW from porn.biz and porn.business, reject messages from spam.com and remove messages from spam.university from the federated timeline: