I came around this solution 52314179 to install and enable imap on docker.
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && docker-php-ext-install imap
Then the imap is installed and enabled but upon using an imap function, an error occurred.
Error: Call to undefined function imap_open()
How to fix this error?
maybe you forgot to restart the container.
Check it here. Link