At the end, it could be a OS-based scanning, so no matter if the message is encrypted in transit, or self-hosted, then if the message is displayed it could be transmitted and scanned.
That will never fly in every Linux distribution (if any at all), so there’s never going to be a way to stop this for even reasonably proficient criminals.