i know dovecot can act as IMAP and POP3 proxy ..... but i'm having a hard time configuring it. Actually i'm using a simple dovecot configuration with virtual users stored on MySQL. My dovecot-sql.conf is pretty simple: [root at correio dovecot]# cat dovecot-sql.conf driver = mysql connect = host=localhost dbname=DATABASE user=USERNAME password=PASSWORD default_pass_scheme = PLAIN # Get the mailbox user_query = select '/var/spool/mail/%u' as home, 'maildir:/var/spool/mail/%u' as mail, 8 as uid, 12 as gid, concat('*:storage=', quota) as quota_rule, 'Trash:storage=100M' as quota_rule2 from emails where endereco = '%u' and ativa = '1' # Get the password password_query = select endereco as user, password, '/var/spool/mail/%u' as userdb_home, 'maildir:/var/spool/mail/%u' as userdb_mail, 8 as userdb_uid, 12 as userdb_gid, concat('*:storage=', quota) as userdb_quota_rule, 'Trash:storage=100M' as userdb_quota_rule2 from emails where endereco = '%u' and ativa = '1' [root at correio dovecot]# i've read several docs about configuring proxy on dovecot but all of them says about proxying specific users .... i'm interested on proxying some domains. I couldnt find a way to configure that nor some howto similar to that. could anyone point me some documentation on configuring dovecot as IMAP/POP3 proxy for a full domain and not specific users ? Ideally i would have a list of domains that should be proxied to somewhere else and all the other domains would be threated locally. Thanks. -- Atenciosamente / Sincerily, Leonardo Rodrigues Solutti Tecnologia http://www.solutti.com.br Minha armadilha de SPAM, N?O mandem email gertrudes at solutti.com.br My SPAMTRAP, do not email it
On 11/03/2010 13:27, Leonardo Rodrigues wrote: [cut]> # Get the password > password_query = select endereco as user, password, > '/var/spool/mail/%u' as userdb_home, 'maildir:/var/spool/mail/%u' as > userdb_mail, 8 as userdb_uid, 12 as userdb_gid, concat('*:storage=', > quota) as userdb_quota_rule, 'Trash:storage=100M' as > userdb_quota_rule2 from emails where endereco = '%u' and ativa = '1' > [root at correio dovecot]# > > > i've read several docs about configuring proxy on dovecot but all > of them says about proxying specific users .... i'm interested on > proxying some domains. I couldnt find a way to configure that nor some > howto similar to that. > > could anyone point me some documentation on configuring dovecot as > IMAP/POP3 proxy for a full domain and not specific users ?Just insert a column in the MySQL table with the host relative to the domain. This is my configuration on the proxy: password_query = SELECT users.clear AS password, domains.host, '%u*proxy' AS destuser, 'proxy' AS pass, 'Y' AS proxy FROM users,domains WHERE users.username = '%u' AND users.enabled = '1' AND domains.domain = '%d' In the table "domains" I have a column "domain" with the list of domains I want to proxy, and a column "host" with the IPof the pop/imap server.
On Thu, 2010-03-11 at 09:27 -0300, Leonardo Rodrigues wrote:> # Get the password > password_query = select endereco as user, password, '/var/spool/mail/%u' > as userdb_home, 'maildir:/var/spool/mail/%u' as userdb_mail, 8 as > userdb_uid, 12 as userdb_gid, concat('*:storage=', quota) as > userdb_quota_rule, 'Trash:storage=100M' as userdb_quota_rule2 from > emails where endereco = '%u' and ativa = '1' > [root at correio dovecot]# > > > i've read several docs about configuring proxy on dovecot but all > of them says about proxying specific users .... i'm interested on > proxying some domains. I couldnt find a way to configure that nor some > howto similar to that.Basically add to your password_query something like: .., domains.host as host, 'Y' as proxy_maybe, .. from emails, domains where domains.domain = '%d', .. So it's really exactly the same as per-user quota, except you're just returning it per-domain in the query. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20100313/120315e6/attachment-0002.bin>
Em 13/03/2010 18:17, Timo Sirainen escreveu:> > Basically add to your password_query something like: > > .., domains.host as host, 'Y' as proxy_maybe, .. > from emails, domains where domains.domain = '%d', .. > > So it's really exactly the same as per-user quota, except you're just > returning it per-domain in the query. >but if i simply add that, query will always return nothing when user is not local. where endereco='%u' will make it return an empty resultset when user does not exists locally. i'm really strugling to discover how, probably with MySQL select syntax, to return one resultset if CONDITION1 (where endereco='%u' exists) and another resultset if CONDITION2 (where domains.domain = '%d' exists) i really dont know to acchieve that .... imap proxying is clear to me, but i couldnt get how to acchieve it for users that does not exists in my local email table ... -- Atenciosamente / Sincerily, Leonardo Rodrigues Solutti Tecnologia http://www.solutti.com.br Minha armadilha de SPAM, N?O mandem email gertrudes at solutti.com.br My SPAMTRAP, do not email it