notes on Sieve and cyrus-imapd-2.2a
Carl P. Corliss
rabbitt at xaraya.com
Thu Jun 12 18:33:17 EDT 2003
On Thursday 12 June 2003 09:54 am, you wrote:
> Carl P. Corliss wrote:
> > Figured I'd let you know what I've found so far while trying to get sieve
> > working on 2.2a
> >
> > lmtpd looks for user scripts in the default domain, and all domains, in:
> >
> > /var/imap/sieve/domain/[hash]/[domain_name]/[hash]/[username]
>
> I've looked at the code and done a test myself and can't reproduce the
> problem. Do you have defaultdomain set correctly?
In my imap.conf I have:
defaultdomain: xaraya.com
yet, all scripts are being looked for in /var/imap/sieve/domain/etc.
After doing some checking around, I've found that in lmtpd.c, function
sieve_find_script(), 'bufuser' contains user at domain.tld even when the user is
in the default domain.
in lmtpd.c, function sieve_find_script():
-----------------------------------------
if (config_virtdomains && (domain = strchr(bufuser, '@'))) {
char d = (char) dir_hash_c(domain+1);
*domain = '\0'; /* split user at domain */
hash = (char) dir_hash_c(user);
snprintf(buf, sizeof(buf), "%s%s%c/%s/%c/%s/default.bc",
sieve_dir, FNAME_DOMAINDIR, d, domain+1,
hash, bufuser);
}
else {
hash = (char) dir_hash_c(bufuser);
snprintf(buf, sizeof(buf), "%s/%c/%s/default.bc",
sieve_dir, hash, user);
}
-----------------------------------------
changing the if statement to:
if (config_virtdomains && (domain = strchr(bufuser, '@')) &&
strcasecmp(domain+1, config_defdomain)) {
-----------------------------------------
allows it to work such that, all default domain users scripts are searched for
in:
/var/imap/sieve/[hash]/[username]
and all non-default domain user's scripts in:
/var/imap/sieve/domain/[hash]/[domainname]/[hash]/[username]
hope this helps ... :)
btw - thanx for such a great app :)
--
Carl P. Corliss
System Administrator / Developer
www.xaraya.com
More information about the Info-cyrus
mailing list