I just migrated from an M2 Mac Mini Pro (Sequoia v15.1) to a new M4 Mac Mini Pro (Sequoia v15.1). During the setup phase on the new mini, I mounted the Time Machine drive from the M2 mini (last backup) and chose to perform the migration during the setup process.
Once I booted from the M4 Mini Pro, Apple Mail popped a dialog indicating that it was performing a Mail conversion. That took about 5 seconds. When I launched Apple Mail, two email accounts requested that I verify with their password. Choosing to do so opens a small web page on that mail account site, where I enter the username and password. That reconciles the Apple Mail account and new mail commences delivery. You will likely need to do this with each of those non-Apple email accounts.