Hello,

I am trying out 2.2.19.rc1 on a lightly loaded server with no problems
so far. The reason I wanted to try 2.2.19.rc1 was to get access to the
%{listener} variable in the auth phase so I can modify the SQL
password_query according to which unix_listener is being queried.

According to the docs, "These variables work only in Dovecot-auth and
login_log_format_elements setting". I can confirm that %{listener}
works in login_log_format_elements but it does not work if I use it in
my SQL auth query.

My logic is as follows:

I create multiple listeners for different SASL authentications in 10
-master.conf


service auth {

  unix_listener auth-userdb {
    mode = 0660
    user = dovecot
    group = vmail
  }

  unix_listener exim-client {
    mode  = 0660
    user  = dovecot
    group = exim
  }

  unix_listener xmpp-client {
    mode  = 0660
    user  = dovecot
    group = mail
  }

  user = $default_internal_user
}



Now I want to use %{listener} in my SQL password_query in a case
statement to auth according to which listener is being used. E.g.

  CASE '%{listener} ' \
    WHEN 'exim-client' THEN ma.SMTPAUTH_allowed = 'YES' \
    WHEN 'xmpp-client' THEN ma.XMPP_allowed = 'YES' \
    ELSE ma.IMAP_allowed = 'YES' \
  END



Should the %{listener} variable work in this case ?




-- 
Greg

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to