On 01/09/2011 09:21 AM, Andrey W. wrote:
> 
> 
> Paul J Stevens wrote:
>>
>>> Did you specify field_nid=dbmailuid in dbmail.conf?
>>
> 
> Yes, of course! Here's field my dbmail.conf:
> ......
> BIND_DN               = uid=dbmail,ou=systemusers,dc=isp,dc=nsc,dc=ru
> BIND_PW               = ******
> SCOPE                 = SubTree
> 
> USER_OBJECTCLASS      =
> top,person,organizationPerson,inetOrgPerson,dbmailUser
> FORW_OBJECTCLASS      =
> top,person,organizationPerson,inetOrgPerson,dbmailUser

I would never do that! Use dbmailForwardingAddress for forward-only setups.

> CN_STRING             = uid
> FIELD_PASSWD          = userPassword
> FIELD_UID             = uid
> FIELD_NID             = dbmailUID
> MIN_NID               = 5
> MAX_NID               = 1000
> FIELD_CID             = dbmailGID
> MIN_CID               = 3
> MAX_CID               = 1000
> FIELD_MAIL            = mail
> FIELD_QUOTA           = mailQuota
> FIELD_FWDTARGET       = mailForwardingAddress
> ......

ok.

> 
> 
> Paul J Stevens wrote:
>>
>> Myself, I always use uidNumber on the posixUser objectClass, but
>> dbmailUid should work just the same.
>>
>> Do you create your ldap users with dbmail-users, or some tool of your own?
>>
> 
> I use JXplorer (for administration) editing LDAP and a webform for users to
> edit their profile (in LDAP). 
> Each user belongs to the object classes: top, person, organizationPerson,
> inetOrgPerson, dbmailUser 

great.

> The schem in my organization (in brackets LDAP attributes are specified): 
> 1. Employees hired 
> 2. Manager fills in the webform (name and surname (cn, sn, givenName),
> position (title), unit (ou), telephone number (phoneNumber), etc.) 
> 3. Immediately by the staff member fills out a form password (userPassword)
> and login (uid, mail) 
> 4. Manager confirms the web-form 
> 5. All OK! Further it is created ldap the LDAP-container and a message is
> sent to new email of employee. And at this point (the message is processing
> by dbmail), 
> I was hoping that dbmail fill field dbmailUID... But it doesn't do it!

That is correct! The *only* dbmail tool that edits the ldap store is
dbmail-users. If you don't use dbmail-users don't use a bind-dn.

> 
> dbmail-users, since doesn't fill all necessary fields:
> # dbmail-users -a test -p md5 -w testpassword -g 1000 -s [email protected]

I know. There is no way to make dbmail-users into the be-all end-all
ldap management tool. Ldap is too flexible for that - as I'm sure you
know. You will have to adapt your user-registration process to fill in
the UID field. Without that field, delivery will fail since the UID
field is used in the sql store as the dbmail_users.user_idnr field.

Here is the bash-code I use myself for finding free UID/GID values:

function ldap_search()
{
        q="$1"
        shift
        a="$@"
        ldapsearch $LDAPOPT $q $a |perl -p0e 's/\n //g' || return 1
}

function _get_free_number()
{
        attr="$1"
        uid="${2}"
        let max=$uid+10000
        while [ $uid -lt $max ]; do
                ldap_search "$attr=$uid" "$attr" | grep ^dn: &>/dev/null
                if [ "$?" = "1" ]; then
                        echo $uid
                        return 0
                fi
                let uid=$uid+1
        done
        return 1
}


function getUidNumber()
{
        _get_free_number "uidNumber" $1
}
function getGidNumber()
{
        _get_free_number "gidNumber" $1
}


# get a free UID above 10000
getUidNumber 10000


---
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to