Should work fine. stunnel is a lower level protocol than IMAP used for SSL/TLS encryption and decryption, and should be transparent to both your email client and the IMAP server. You should use port 143 for IMAP in your client, rather than 993 for SSL over IMAP, which you will connect to in stunnel. See
http://www.eee.metu.edu.tr/network/pmail/ for a setup example using Pegasus. If you are using OE or TB, should be able to just follow the setup wizard there.
Note: I am not really an IMAP user, but set it up using TB, avast!, stunnel to verify there are no problems. works fine.
stunnel.conf addition looks like
# IMAP service listens on localhost 11143
[dslx-imap]
accept=localhost:11143
connect=mail.dslextreme.com:993
remembered to terminate and restart stunnel this time to load the new stunnel.conf
Added 11143 to the redirect ports and activated IMAP scanning in the email provider in avast!
Used localhost port 11143 as the imap mailserver in TB, no SSL