Discussion:
[Dovecot] How can I configure dovecot as gmail imap proxy
Supratik Goswami
2010-01-15 06:37:20 UTC
Permalink
Hi,

I want to configure dovecot as gmail imap proxy. If any system in my network
wants to connect to imap.gmail.com,993 it has to go through the dovecot
proxy.

Is it possible to setup such environment with dovecot? If yes, can you
please
help me to configure my dovecot server.

Warm Regards

Supratik
Andrzej Adam Filip
2010-01-16 12:06:21 UTC
Permalink
Post by Supratik Goswami
I want to configure dovecot as gmail imap proxy. If any system in my network
wants to connect to imap.gmail.com,993 it has to go through the dovecot
proxy.
Is it possible to setup such environment with dovecot? If yes, can you
please
help me to configure my dovecot server.
Have you considered using fetchmail to fetch new messages from gmail to
local IMAP/dovecot folder(s)? [ I use such configuration ]
--
[pl>en: Andrew] Andrzej Adam Filip : anfi at onet.eu
You can bring any calculator you like to the midterm, as long as it
doesn't dim the lights when you turn it on.
-- Hepler, Systems Design 182
Timo Sirainen
2010-01-19 12:50:45 UTC
Permalink
Post by Supratik Goswami
I want to configure dovecot as gmail imap proxy. If any system in my network
wants to connect to imap.gmail.com,993 it has to go through the dovecot
proxy.
Is it possible to setup such environment with dovecot? If yes, can you
please
help me to configure my dovecot server.
I don't understand. What would the proxy do?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20100119/fb4d72d7/attachment.bin
Supratik Goswami
2010-01-20 06:17:50 UTC
Permalink
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
Timo Sirainen
2010-01-20 09:11:33 UTC
Permalink
Post by Supratik Goswami
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.
So you first need a way to redirect all imap.gmail.com connections to dovecot proxy. "Transparent proxy" is the correct google keyword for this, but I've never done one myself.

Then you need the actual Dovecot proxy configuration. Where were you planning on keeping the usernames? With SQL you could do something like:

password_query = SELECT NULL as password, 'y' as nopassword, 'y' as proxy, '209.85.135.111' as host from users where username = '%u'

Dovecot proxy doesn't currently support DNS lookups, so you need to return one of imap,gmail.com's IP addresses directly.
Loading...