Hi Sam,
That's not correct. DEFAULTDELIVERY is *not* the last field in the custom query. Read the comments for the detailed explanation:
# $(service) will expand out to the service being authenticated: imap, imaps, # pop3 or pop3s. Courier mail server only: service will also expand out to # "courier", when searching for local mail account's location. In this case, # if the "maildir" field is not empty it will be used in place of # DEFAULTDELIVERY. Courier mail server will also use esmtp when doing # authenticated ESMTP.
You want the maildir field to contain something like:
IF(STRCMP('$(service)', 'courier') == 0, users.delivery, '')
I'm not quite sure what you mean. The maildir field can be conditional like that? I'm confused, sorry! :-/
You are using a custom SELECT query. Any valid SQL, as long as it returns the requisite number of fields, may be used.
pgp00000.pgp
Description: PGP signature