We were facing a challenge where we wanted the ~/.qmail* to be honored
when qmailDotMode=ldapwithprog was set. After working through the code,
it became apparent that the best way (for us) to resolve this issue was
to add another qmailDotMode (bothwithprog).
Below is my patch against our local qmail-ldap tree that we run to offer
such a feature. This may or may not patch cleanly against other source
trees, and has not been tested against a straight 'qmail-ldap-patched'
tree, but it shouldn't be too hard to patch manually given the diff below.
diff -dc qmail-1.03-ldap/qmail-ldap.h qmail-bothwithprog/qmail-ldap.h
*** qmail-1.03-ldap/qmail-ldap.h Tue Aug 31 18:34:39 1999
--- qmail-bothwithprog/qmail-ldap.h Mon Jul 2 12:55:33 2001
***************
*** 42,47 ****
--- 42,48 ----
#define DOTMODE_LDAPONLY "ldaponly"
#define DOTMODE_LDAPWITHPROG "ldapwithprog"
+ #define DOTMODE_BOTHWITHPROG "bothwithprog"
#define DOTMODE_DOTONLY "dotonly"
#define DOTMODE_BOTH "both"
#define DOTMODE_NONE "none"
diff -dc qmail-1.03-ldap/qmail-local.c qmail-bothwithprog/qmail-local.c
*** qmail-1.03-ldap/qmail-local.c Tue Aug 31 18:34:39 1999
--- qmail-bothwithprog/qmail-local.c Mon Jul 2 12:57:43 2001
***************
*** 888,893 ****
--- 888,897 ----
} else if ( !str_diff(DOTMODE_BOTH, s) ) {
if (!flagdoit) sayit("DOTMODE_BOTH ",s,0);
qmode = DO_BOTH;
+ } else if ( !str_diff(DOTMODE_BOTHWITHPROG,s) ) {
+ if (!flagdoit) sayit("DOTMODE_BOTHWITHPROG ",s,0);
+ qmode = DO_BOTH;
+ ldapprogdelivery = 1;
} else if ( !str_diff(DOTMODE_NONE, s) ){
++count_file;
if (!stralloc_copys(&foo,aliasempty)) temp_nomem();
diff -dc qmail-1.03-ldap/qmail-lspawn.c qmail-bothwithprog/qmail-lspawn.c
*** qmail-1.03-ldap/qmail-lspawn.c Tue Aug 31 18:34:39 1999
--- qmail-bothwithprog/qmail-lspawn.c Mon Jul 2 13:01:51 2001
***************
*** 712,718 ****
ldap_value_free(vals);
}
! /* get the mode of the .qmail interpretion: ldaponly, dotonly, both, none */
if ( (vals = ldap_get_values(ld,msg,LDAP_DOTMODE)) != NULL ) {
case_lowers(vals[0]);
// DEBUG(ENV_DOTMODE,"(from server): ", vals[0], "\n");
--- 712,718 ----
ldap_value_free(vals);
}
! /* get the mode of the .qmail interpretion: ldaponly, dotonly, both,
bothwithprog, none */
if ( (vals = ldap_get_values(ld,msg,LDAP_DOTMODE)) != NULL ) {
case_lowers(vals[0]);
// DEBUG(ENV_DOTMODE,"(from server): ", vals[0], "\n");
***************
*** 728,733 ****
--- 728,736 ----
} else if ( !str_diff(DOTMODE_BOTH, vals[0]) ) {
if ( !env_put2(ENV_DOTMODE, DOTMODE_BOTH) ) _exit(QLX_NOMEM);
DEBUG(ENV_DOTMODE,": ",DOTMODE_BOTH, "\n");
+ } else if ( !str_diff(DOTMODE_BOTHWITHPROG, vals[0]) ) {
+ if ( !env_put2(ENV_DOTMODE, DOTMODE_BOTHWITHPROG) ) _exit(QLX_NOMEM);
+ DEBUG(ENV_DOTMODE,": ",DOTMODE_BOTHWITHPROG, "\n");
} else if ( !str_diff(DOTMODE_NONE, vals[0]) ) {
if ( !env_put2(ENV_DOTMODE, DOTMODE_NONE) ) _exit(QLX_NOMEM);
DEBUG(ENV_DOTMODE,": ",DOTMODE_NONE, "\n");