Currently the KMail Account Wizard depends on Kross (which depends on the deprecated QtScript) to allow resources to "script" the account wizard flow.
In order to get rid of the Kross and QtScript dependencies (QtScript is basically dead and will be completely removed in Qt6 anyway), we should port the account wizard to support "scripting" or rather extending through QML.
This task does not require much Akonadi knowledge (just some basic concepts, there's an exhaustive description on the wiki), but requires some QML skills, as well as C++ coding. This is not a small change (i.e. not something that can be done in a single evening), but it's not massive either (so that it would take months to finish). The work can happen incrementally in smaller steps, it's not necessary to accomplish the whole task in a single commit.