Here the proxy server should authenticate the user. If the user is in the list of authenticated users then dovecot will allow to connect to imap.gmail.com.
Consider a scenario where a client tries to read his mailbox from imap.gmail.com:993. Client executes the command "mutt -f imaps://imap.gmail.com", the request is first authenticated at the proxy server. If the request is coming from a valid user, dovecot will allow to connect to imap.gmail.com and fetch mails for that user. Can you please help me with the steps to configure the server. Warm Regards Supratik