Cyrus domain resolution

Dan White dwhite at olp.net
Wed Mar 23 14:55:20 EDT 2011


On 23/03/11 20:24 +0200, Vilius Šumskas wrote:
>> > >> sasl_default_realm
>> > >
>> > > Still doesn't work. %r resolves to 'mail.example.com'
>> > >
>> >
>> > With?
>> >
>> > virtdomains: yes
>>
>> Yes with. I have also tried virtdomains: yes, virtdomains: on and virtdomains:
>> userid.
>
>It seems that this is an issue with SASL. Postfix SMTP auth which uses
>SASL behaves exactly the same. %r is resolved to hostname :(
>
>Any ideas?

plugins/sql.c does:

     if(sparams->user_realm) {
         user_realm = sparams->user_realm;
     } else {
         user_realm = sparams->serverFQDN;
     }

Where user_realm would represent the sasl realm derived from the sasl
mechanism used. I don't believe either LOGIN or PLAIN support the passing of
a sasl realm, or generate one.

serverFQDN represents the value passed to sasl_server_init, which in
imap/imapd.c is:

     if (sasl_server_new("imap", config_servername,
             NULL, NULL, NULL, NULL, 0,
             &imapd_saslconn) != SASL_OK) {

config_servername is generated from :
lib/libconfig.c:

     /* look up the hostname and info we should present to the user */
     config_servername = config_getstring(IMAPOPT_SERVERNAME);
     if (!config_servername) {
         config_servername = xmalloc(sizeof(char) * 256);
         gethostname((char *) config_servername, 256);
     }

You should be able to set a 'servername' value in imapd.conf to essentially
hard code a value for %r. It may make more sense to disregard %r
altogether, and get your domain information from %u.

-- 
Dan White


More information about the Info-cyrus mailing list