[Dovecot] Dovecot SQL user_query

Alex dovecot at mailswamp.com
Tue May 4 02:00:41 EEST 2010


Hello folkz,
Is it possible to setup in dovecot-sql.conf  file to run user_query
twice if its first run didn't yield any values.
And likewise don't proceed with the second run if the first user_query
execution produced the result.
I have to query two tables which specify there email messages shall be
delivered via Dovecot deliver LDA
depending on the incoming email addresses.

Please don't question me about this setup. I inherited this mess from
the previous Network Admin.
 
First query should be ran like this:
user_query = SELECT concat('maildir:/data/mail/',maildir) as mail FROM
folders WHERE email = '%u'

If the first query doesn't yield any result the second shall be ran like
this:
user_query = SELECT maildir as home FROM users WHERE email = '%u'

Please advise if such user_query setup is possible at all.

Thanks in advance,

Alex




More information about the dovecot mailing list