Looking at your old mails, you seem to be using passdb static for director, but userdb sql? So you could switch to:
passdb { driver = sql args = /etc/dovecot/dovecot-sql.conf }
password_query = select 'y' as proxy, 'y' as nopassword, if('%a'=143, 1430, 9930) as port
where you'd change the if() to something that handles %s=imap vs %s=pop3 vs %s=lmtp and %a=143 vs %a=993 vs %a=110 vs %a=995. Maybe a "case" statement would be less ugly. Or simply make it a real table in sql. Anyway, that's the basic idea.
On 11.6.2012, at 15.39, Костырев Александр Алексеевич wrote:
thanks Timo, for you time but I still don't get it) should I return "port" with just "port_num1,port_num2" value or how? I've tried to google an example but with no success.
-----Original Message----- From: Timo Sirainen [mailto:tss@iki.fi] Sent: Monday, June 11, 2012 11:01 PM To: Костырев Александр Алексеевич Cc: dovecot@dovecot.org Subject: Re: [Dovecot] director: non standart ports at backends
On 11.6.2012, at 12.27, Костырев Александр Алексеевич wrote:
hello, I'm trying to figure out how to proxy pop3 and pop3s that listens on non-standart ports at backends. For example, pop3 is at 1110 and pop3s at 1995 (on backend side). is it possible? how should I separate this ports in director's config? it's easy for one port: for example lmtp - you just use passdb in protocol lmtp {}
The passdb needs to return the "port" field. You can't use static passdb for this, since it has no conditionals and you can't do per-port configuration. Maybe use sqlite (simply to use it as a scripting engine - empty database) or checkpassword as your passdb.