Users are retrieving mail using pop3 over the external ip address. When the user connects to there webmail. The webmail client (Squirrelmail) is using imap on the localhost. I would like to give some users the option to use imap over the external ip, I want to set option in my MySql backend configuration. As far as I know there isn't a possible solution on dovecot right now that's why I hope you can build a extra config parameter that gives me the possibility to allow users to retrieve email by imap by ip. So all users can do an imap request on localhost (for webmail) and some user are allowed to do an imap request over the external ip.
If I understand you correctly, you can do this by having your authentication query return nothing if they use IMAP unless it was enabled for them, see the wiki.
johannes