The setuserattr() command adds attributes to a user account or changes existing attributes.
The user account can be viewed in the Users.
Structure of the command
setuserattr('attr','value');
Return value
positive |
always |
Parameters
ATTR and VALUE
The following system attributes (attr) are available with the corresponding values (value) according to the following table:
ATTR |
VALUE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accountOptions |
Bit 0: User may not encrypt (see User Data May not encrypt mails) Bit 1: User may not encrypt Bit 3: Always send GINA notification (see User Data Notifications always:)
Default value is '0' (may sign, encrypt, no GINA notification) '5' sets the user to inactive which releases the Signature And Encryption license. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mpkiSubjectPart |
User-specific subject part (see User Data MPKI subject part) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SN |
Name of the user (see User Data Full name) variables available! |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UID |
User ID of the user (see User Data User ID) variables available! |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
•All attributes of InetOrgPerson can be used. •The attributes can be displayed in the administration interface.
The unique identifier of a SEPPmail Secure E-Mail Gateway user account is the email address, which is why it cannot be changed. |
Example 1
Line |
Code |
|---|---|
01 |
if(ldap_compare('192.168.10.10,192.168.10.11;CN=Peter Mueller,OU=SBSUsers,OU=Users,OU=MyBusiness,DC=Company,DC=local;mypassword;OU=SBSUsers,OU=Users,OU=MyBusiness,DC=Company,DC=local;(mail=$sender)','memberOF','SecureMail')) { |
02 |
if(authenticated()) { |
03 |
setuserattr('accountOptions','16'); |
04 |
} |
05 |
} |
Explanation
This example checks whether the sender is a member of the "support" group (line 01). If yes, it is checked by means of authenticated() whether the sender is already defined as a user in the appliance (line 02). If both these conditions apply, the command setuserattr() is used to assign the right for "encryption and signing" and GINA notifications (read notifications) according to the default settings of the respective GINA domain (line 03).
Example 2
Line |
Code |
|---|---|
01 |
ldap_read('172.16.161.5;CN=ldapquery,OU=ServiceAccounts,OU=UserDC=customer1,DC=local;Password;OU=User,DC=customer1,DC=local;(mail=$from)','StaticSubjectPart','StaticSubjectPart'); |
02 |
ldap_read('172.16.161.5;CN=ldapquery,OU=ServiceAccounts,OU=User,DC=customer1,DC=local;Password;OU=User,DC=customer1,DC=local;(mail=$from)','displayName','displayName'); |
03 |
ldap_read('172.16.161.5;CN=ldapquery,OU=ServiceAccounts,OU=User,DC=customer1,DC=local;Password;OU=User,DC=customer1,DC=local;(mail=$from)','sAMAccountName','sAMAccountName'); |
04 |
setuserattr('UID','$sAMAccountName'); |
05 |
setuserattr('SN','$displayName'); |
06 |
setuserattr('mpkiSubjectPart','$StaticSubjectPart'); |
Explanation
In this example, in lines 01 - 03 the values for "Static Subject Part", "display name" and "user ID" are read from an LDAP and written into variables of the same name. In lines 04 - 06 these values are taken over for the SEPPmail user.

