This is the only way I could get maildrop working with my virtual setup
where user home directory stored in ldap is not the absulute filesystem
path.
It allows the setting of a default_homedirectory instead of getting this
from LDAP. This was maildrop has a directory to work form and can read
in its maildroprc to get the rest of its setup.
*** maildrop-1.7.0.20040907/maildrop/mdldap.c Sat Jun 26 16:20:14 2004
--- maildrop/maildrop/mdldap.c Thu Nov 4 17:40:49 2004
***************
*** 131,136 ****
--- 131,138 ----
if ( ldap_count_values(values) > 0 ) {
rec->homedirectory = strdup(values[0]);
ldap_value_free(values);
+ } else if ( cfg->default_homedirectory ) {
+ rec->homedirectory = cfg->default_homedirectory;
} else {
rec->homedirectory = NULL;
}
*** maildrop-1.7.0.20040907/maildrop/mdldapconfig.h Sat Jun 26
16:20:14 2004
--- maildrop/maildrop/mdldapconfig.h Thu Nov 4 17:34:49 2004
***************
*** 37,42 ****
--- 37,43 ----
int default_uidnumber;
int default_gidnumber;
char *default_quota;
+ char *default_homedirectory;
int timeout;
} mdldapconfig;
*** maildrop-1.7.0.20040907/maildrop/mdldapconfig.c Sat Jun 26
16:20:14 2004
--- maildrop/maildrop/mdldapconfig.c Thu Nov 4 17:32:47 2004
***************
*** 99,104 ****
--- 99,107 ----
if ( !strcasecmp(var,"default_quota") )
cfg->default_quota = (char*)strdup(val);
+
+ if ( !strcasecmp(var,"default_homedirectory") )
+ cfg->default_homedirectory =
(char*)strdup(val);
}
fclose(fp);