2 .\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3 .\" <!-- distribution information. -->
4 .\" Title: auth_getuserinfo
5 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
6 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
8 .\" Manual: Double Precision, Inc.
9 .\" Source: Double Precision, Inc.
12 .TH "AUTH_GETUSERINFO" "3" "08/25/2013" "Double Precision, Inc." "Double Precision, Inc."
13 .\" -----------------------------------------------------------------
14 .\" * Define some portability stuff
15 .\" -----------------------------------------------------------------
16 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 .\" http://bugs.debian.org/507673
18 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
19 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 .\" -----------------------------------------------------------------
23 .\" * set default formatting
24 .\" -----------------------------------------------------------------
25 .\" disable hyphenation
27 .\" disable justification (adjust text to left margin only)
29 .\" -----------------------------------------------------------------
30 .\" * MAIN CONTENT STARTS HERE *
31 .\" -----------------------------------------------------------------
33 auth_getuserinfo \- Obtain account information
37 #include <courierauth\&.h>
39 .HP \w'int\ rc=auth_getuserinfo('u
40 .BI "int rc=auth_getuserinfo(const\ char\ *" "userid" ", int\ " "(*callback_func)" "(struct\ authinfo\ *,\ void\ *), void\ *" "callback_arg" ");"
45 is a valid account name, retrieve the account particulars and invoke
46 \fIcallback_func\fR\&.
53 \fBcallback_func\fR\*(Aqs return value becomes the return value from
54 \fBauth_getuserinfo\fR
55 (which should be 0, by convention)\&.
57 will not be invoked if an error occurs, which is reported by a non\-zero return value from
58 \fBauth_getuserinfo\fR\&. By convention, a positive return value indicates an internal, temporary failure, such as the authentication daemon process not running; a negative return value indicates that this request was processed, but it failed (probably because
62 The second argument to
65 \fBcallback_arg\fR, which is not interpreted by this function in any way\&. The first argument will be a pointer to the following structure:
67 \fBExample\ \&1.\ \&struct authinfo\fR
74 const char *sysusername;
75 const uid_t *sysuserid;
84 const char *clearpasswd;
94 Description of the above fields:
98 The authenticated login ID\&.
103 The authenticated account\*(Aqs userid and groupid can be looked up in the password file using
104 address\&. If this field is
105 NULL, obtain the userid and the groupid from
118 is initialized, otherwise it\*(Aqs a pointer to the account\*(Aqs numeric userid\&.
123 Account\*(Aqs numeric groupid\&.
133 This is the account\*(Aqs full name\&. This field is optional, it may be
139 The account\*(Aqs home directory\&. This field cannot be
145 The pathname to the account\*(Aqs mailbox\&. This field is optional, it can be
147 in which case the default location is assumed\&.
152 Optional maildir quota on the account\*(Aqs mailbox (and
154 if no quota is set)\&.
159 The account\*(Aqs encrypted password, if available\&. If the account has a cleartext password defined, this field can be set to
160 NULL\&. The encrypted password can take several formats:
170 A traditional triple\-DES crypted password, or a MD5+salt\-hashed password, as used in Linux\&.
182 followed by a base64\-encoded MD5 hash of the password\&.
194 followed by a base64\-encoded SHA1 hash of the password\&.
200 The account\*(Aqs cleartext password, if available\&. If the account has an encrypted password defined, this field can be set to
206 A comma\-separated list of miscellaneous account options\&. See below for more information\&.
208 .SS "Account options"
210 Depending on the configuration of the Courier authentication library, accounts may have individual options associated with them\&. If the authentication library configuration does not implement account options, the option string will be a
212 value\&. Otherwise it will be a comma\-separated list of
213 \(lq\fIoption\fR=\fIvalue\fR\(rq
220 .nr an-no-space-flag 1
228 The application is responsible for actually implementing the options\&. For example, sn authentication request for service
229 \(lqimap\(rq, for example, will succeed provided that the userid and the password are valid, even if
230 \(lqdisableimap=1\(rq
231 is set\&. The application\*(Aqs
233 should check for this condition, and return a negative return code\&.
241 .nr an-no-space-flag 1
249 The following list of account options is a combined list of implemented options supported by Courier, Courier\-IMAP, and SqWebMail packages\&. Some of the following information is obviously not applicable for a particular package\&. The inapplicable bits should be obvious\&.
253 The following options are recognized by the various Courier packages:
257 If "n" is 1, IMAP access to this account should be disabled\&.
262 If "n" is 1, POP3 access to this account should be disabled\&.
265 disableinsecureimap=\fIn\fR
267 If "n" is 1, unencrypted IMAP access to this account should be disabled\&.
270 disableinsecurepop3=\fIn\fR
272 If "n" is 1, unencrypted POP3 access to this account should be disabled\&.
275 disablewebmail=\fIn\fR
277 If "n" is 1, webmail access to this account should be disabled\&.
280 disableshared=\fIn\fR
282 If "n" is 1, this account should not have access to shared folders or be able to share its own folders with other people\&.
287 This option is used by Courier\-IMAP in calculating access control lists\&. This option places the account as a member of access group
288 \fIname\fR\&. Instead of granting access rights on individual mail folders to individual accounts, the access rights can be granted to an access group
289 \(lqname\(rq, and all members of this group get the specified access rights\&.
291 The access group name
292 \(lqadministrators\(rq
293 is a reserved group\&. All accounts in the
295 group automatically receive all rights to all accessible folders\&.
301 .nr an-no-space-flag 1
308 This option may be specified multiple times to specify that the account belongs to multiple account groups\&.
313 sharedgroup=\fIname\fR
315 Another option used by Courier\-IMAP\&. Append "name" to the name of the top level virtual shared folder index file\&. This setting restricts which virtual shared folders this account could possibly access (and that\*(Aqs on top of whatever else the access control lists say)\&. See the virtual shared folder documentation for more information\&.
317 For technical reasons, group names may not include comma, tab, "/" or "|" characters\&.
321 \m[blue]\fB\fBauthlib\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2,
322 \m[blue]\fB\fBauth_generic\fR(3)\fR\m[]\&\s-2\u[2]\d\s+2,
323 \m[blue]\fB\fBauth_login\fR(3)\fR\m[]\&\s-2\u[3]\d\s+2,
324 \m[blue]\fB\fBauth_enumerate\fR(3)\fR\m[]\&\s-2\u[4]\d\s+2,
325 \m[blue]\fB\fBauth_passwd\fR(3)\fR\m[]\&\s-2\u[5]\d\s+2,
326 \m[blue]\fB\fBauth_getoption\fR(3)\fR\m[]\&\s-2\u[6]\d\s+2\&.
331 \%[set $man.base.url.for.relative.links]/authlib.html
334 \fBauth_generic\fR(3)
336 \%[set $man.base.url.for.relative.links]/auth_generic.html
341 \%[set $man.base.url.for.relative.links]/auth_login.html
344 \fBauth_enumerate\fR(3)
346 \%[set $man.base.url.for.relative.links]/auth_enumerate.html
351 \%[set $man.base.url.for.relative.links]/auth_passwd.html
354 \fBauth_getoption\fR(3)
356 \%[set $man.base.url.for.relative.links]/auth_getoption.html