And so, where is the problem?.. Your message is scanned. If it is illegitimate you can’t send it. What is the problem?
What I do is a local backup on a different disk with BorgBackup, then a copy of that local backup to a Pi at a friend’s place, with rsync.
I have self-hosted Matrix for a couple of years. I eventually settled with xmpp/ejabberd/conversations. It is easier to maintain and less resource intensive, especially if you want to go the federation route.