I think you’ll need to use the API to script the create/modify the doctype controlling either the default sending account/active email account or use a testing environment that blocks outbound email ports using firewall rules.
If time/production requirements allow, you can disable the account prior to making the backup, and then enable it when the backup finishes.
Alternatively, you can find the setting within the text based SQL dump and manually edit the .SQL file to change the value of the sending email account, prior to the restore.
very good points volkswagner (and good name, too;) SQL might be the way to go, maybe even a cron job that disables the mail account every other hour or so. A firewall setting on the mta seems even more elegant though
After restoring your bd on “rubber-cell” site … have restored site_config.json or encryption_key value? AFAIK, and without encryption_key, stored passwords can’t be decrypted, so email shouldn’t work. Just curiosity …
Anyway, for testing purposes, I use to switch mail configuration to mailtrap account. It’s a fantastic tool. You can test any email behavior without sending out real emails.