How about using 'unar' - a command line version of 'The Unarchiver' (https://theunarchiver.com/) which supports a lot of formats (including 7z, RAR, ...) and is available on several Linux distros?
Currently unsupported [1] by Amavis.
[1] https://gitlab.com/amavis/amavis/-/issues/84
