Implemented a new prop, dovecot/RestrictedAccessGroup. The value is a long group name. Members of the given group have IMAP access restricted to trusted networks.
In a next iteration an UI field can be added under Email > Mailboxes tab.
Just thinking out loud:
What if we can use a geo block instead of a single IP address? If a Mailserver is directly connected to the internet, it might be a nice featurew to block all IP addresses that do not come from your country part of the world. If you are in Europe and you could filter out access from Russia, USA, China, etc… just my gut feeling, but it might limit a lot of unwanted traffic.