Hi,
I think you should following these steps I am sure they will worked properly and also important to access:
- Check Documentation and Changelog: Look at the latest Dovecot documentation and changelogs to see if there are any notes about the imap_zlib plugin being moved renamed or deprecated. 
- Rebuild with Plugin: Ensure you have the necessary dependencies installed for zlib and then rebuild Dovecot with plugin support by configuring it explicitly. You can use the configure with zlib option before compiling. 
- Check for Alternative Repositories: Sometimes plugins may be maintained separately. Check if there is an independent repository or branch that includes the imap zlib plugin. 
- Contact Dovecot Community: If the plugin has been removed, consider reaching out to the Dovecot community or mailing list for alternative solutions or to understand the reason for its removal. 
Thanks