I figured I'd expand on my original message... I was working off of memory of code I edited a year ago.
 
Adding additional accountStatus types was easy as pie for me:
 
1.) First, edit qmail-ldap.h and modify the section about #define ISACTIVE_...
#define ISACTIVE_BOUNCE "disabled"
#define ISACTIVE_BOUNCE2 "delete"
#define ISACTIVE_NOPOP  "onhold"
#define ISACTIVE_ACTIVE "active"
You'll note that I added "ISACTIVE_BOUNCE2" which I defined as "delete". As I mentioned earlier, this is my accountStatus for my auto delete script. I happened to change the other status lines, but you don't have too. Only a naming convention.
 
2.) Second, edit qmail-lspawn.c. I hope over to about line 586:
 
   /* check if the ldap entry is active */
   if ( (vals = ldap_get_values(ld,msg,LDAP_ISACTIVE)) != NULL ) {
      DEBUG("is_active: ", vals[0], "\n", 0);
      if ( !str_diff(ISACTIVE_BOUNCE, vals[0]) ) _exit(225);
      if ( !str_diff(ISACTIVE_BOUNCE2, vals[0]) ) _exit(225);
   }
I copied and modified the line ISACTIVE_BOUNCE2 to mimick that of ISACTIVE_BOUNCE. So, effectivly, I wanted to make my accountStatus=delete the same as accountStatus=disabled as far as mail delivery is concerned.
 
3.) Modify checkpassword.c at around line 279:
   /* check if the ldap entry is active */
   if ( (vals = ldap_get_values(ld,msg,LDAP_ISACTIVE)) != NULL ) {
      debug_msg(OUTPUT," accountStatus is\t: %s\n", vals[0]);
      if ( !str_diff(ISACTIVE_BOUNCE, vals[0]) ) _exit(4);
      if ( !str_diff(ISACTIVE_BOUNCE2, vals[0]) ) _exit(4);
      if ( !str_diff(ISACTIVE_NOPOP, vals[0]) ) _exit(4);
   }
Again, I added the BOUNCE2 line to reject POP logins along with the pre-existing BOUNCE and NOPOP
 
 
NOW! All that being said. I use a rather old version of qmail-ldap. Your mileage will vary. checkpassword is now all but defunct... All that stuff has been moved to auth_*....
 
Have fun!
 
-James
 
---------------------------------------------------------
James Tavares <[EMAIL PROTECTED]>
Sr. Data Network Engineer
Log On America, Inc.
 
Ph: 1-401-459-6294
Fax: 1-401-459-6580
Web: http://www.loa.com/
----- Original Message -----
Sent: Wednesday, April 18, 2001 7:39 AM
Subject: Re: accountStatus

You would have to modify qlapd.h and add extra definitions:

#define .._TERMINATED "terminated"
#define .._BLAHBLAH "blahblah"
 
And then in the auth_* modules and in qmail-lspawn (I havn't seen the latest code, this stuff might have been mergered into a single library of functions) add additional checks... I remember in my version on the code they were simple one line IF() {} statements that compared the value of the returned accountStatus attribute one at a time to pre-existing ...BOUNCE, ..NOPOP, and ..ACTIVE
 
You just have to copy and modify the appropiate if() {} statement for the type of action your new accountStatus would like to perform. For example, I added a "delete" accountStatus so that my auto-delete script could come by 30 days later and remove content, etc... I copied the if() {} statement that checked for ...BOUNCE (which is currently "disabled") and copied it and modified it for by new #define'd .._DELETE.
 
Thanks,
James
 
---------------------------------------------------------
James Tavares <[EMAIL PROTECTED]>
Sr. Data Network Engineer
Log On America, Inc.
Ph: 1-401-459-6294
Fax: 1-401-459-6580
Web: http://www.loa.com/
----- Original Message -----
From: Yim K. F.
Sent: Wednesday, April 18, 2001 6:40 AM
Subject: accountStatus

 

Just want to know if other status such as (suspend, terminated<but may be re-activated>...) can be put in accountStatus for service control requirements without affecting qmailLDAP capability.

KF



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Reply via email to