Move AFS vmail tokens to preauthuserdbcommon.c.
[hcoop/debian/courier-authlib.git] / auth_getuserinfo.3
1 .\" <!-- $Id: auth_getuserinfo.sgml,v 1.4 2007/07/21 20:05:53 mrsam Exp $ -->
2 .\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3 .\" <!-- distribution information. -->
4 .\" Title: auth_getuserinfo
5 .\" Author:
6 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
7 .\" Date: 07/21/2007
8 .\" Manual: Double Precision, Inc.
9 .\" Source: Double Precision, Inc.
10 .\"
11 .TH "AUTH_GETUSERINFO" "3" "07/21/2007" "Double Precision, Inc." "Double Precision, Inc."
12 .\" disable hyphenation
13 .nh
14 .\" disable justification (adjust text to left margin only)
15 .ad l
16 .SH "NAME"
17 auth_getuserinfo \- Obtain account information
18 .SH "SYNOPSIS"
19 .sp
20 .RS 4
21 .nf
22 #include <courierauth.h>
23 .fi
24 .RE
25 .HP 24
26 .BI "int rc=auth_getuserinfo(const\ char\ *" "userid" ", int\ " "(*callback_func)" "(struct\ authinfo\ *,\ void\ *), void\ *" "callback_arg" ");"
27 .SH "DESCRIPTION"
28 .PP
29 If
30 \fIuserid\fR
31 is a valid account name, retrieve the account particulars and invoke
32 \fIcallback_func\fR.
33 .SH "RETURNS"
34 .PP
35
36 \fBcallback_func\fR
37 will be invoked if
38 \fIuserid\fR
39 exists, and
40 \fBcallback_func\fR's return value becomes the return value from
41 \fBauth_getuserinfo\fR
42 (which should be 0, by convention).
43 \fBcallback_func\fR
44 will not be invoked if an error occurs, which is reported by a non\-zero return value from
45 \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
46 \fIuserid\fR
47 does not exist.
48 .PP
49 The second argument to
50 \fBcallback_func\fR
51 will be
52 \fBcallback_arg\fR, which is not interpreted by this function in any way. The first argument will be a pointer to the following structure:
53 \fBExample\ 1.\ struct authinfo\fR
54 .sp
55 .RS 4
56 .nf
57 struct authinfo {
58 const char *sysusername;
59 const uid_t *sysuserid;
60 gid_t sysgroupid;
61 const char *homedir;
62
63 const char *address;
64 const char *fullname;
65 const char *maildir;
66 const char *quota;
67 const char *passwd;
68 const char *clearpasswd;
69
70 const char *options;
71
72 } ;
73 .fi
74 .RE
75 .PP
76 Description of the above fields:
77 .PP
78 address
79 .RS 4
80 The authenticated login ID.
81 .RE
82 .PP
83 sysusername
84 .RS 4
85 The authenticated account's userid and groupid can be looked up in the password file using
86 address. If this field is
87 NULL, obtain the userid and the groupid from
88 sysuserid
89 and
90 sysgroupid.
91 .RE
92 .PP
93 sysuserid
94 .RS 4
95
96 sysuserid
97 may be
98 NULL
99 if
100 sysusername
101 is initialized, otherwise it's a pointer to the account's numeric userid.
102 .RE
103 .PP
104 sysgroupid
105 .RS 4
106 Account's numeric groupid.
107 sysgroupid
108 is only used when
109 sysusername
110 is
111 NULL.
112 .RE
113 .PP
114 fullname
115 .RS 4
116 This is the account's full name. This field is optional, it may be
117 NULL.
118 .RE
119 .PP
120 homedir
121 .RS 4
122 The account's home directory. This field cannot be
123 NULL.
124 .RE
125 .PP
126 maildir
127 .RS 4
128 The pathname to the account's mailbox. This field is optional, it can be
129 NULL
130 in which case the default location is assumed.
131 .RE
132 .PP
133 quota
134 .RS 4
135 Optional maildir quota on the account's mailbox (and
136 NULL
137 if no quota is set).
138 .RE
139 .PP
140 passwd
141 .RS 4
142 The account's encrypted password, if available. If the account has a cleartext password defined, this field can be set to
143 NULL. The encrypted password can take several formats:
144 .RS 4
145 \h'-04'\(bu\h'+03'A traditional triple\-DES crypted password, or a MD5+salt\-hashed password, as used in Linux.
146 .RE
147 .RS 4
148 \h'-04'\(bu\h'+03'
149 \(lq{MD5}\(rq
150 followed by a base64\-encoded MD5 hash of the password.
151 .RE
152 .RS 4
153 \h'-04'\(bu\h'+03'
154 \(lq{SHA}\(rq
155 followed by a base64\-encoded SHA1 hash of the password.
156 .RE
157 .RE
158 .PP
159 clearpasswd
160 .RS 4
161 The account's cleartext password, if available. If the account has an encrypted password defined, this field can be set to
162 NULL.
163 .RE
164 .PP
165 options
166 .RS 4
167 A comma\-separated list of miscellaneous account options. See below for more information.
168 .RE
169 .SS "Account options"
170 .PP
171 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
172 NULL. Otherwise it will be a comma\-separated list of
173 \(lq\fIoption\fR=\fIvalue\fR\(rq
174 settings.
175 .sp
176 .it 1 an-trap
177 .nr an-no-space-flag 1
178 .nr an-break-flag 1
179 .br
180 \fBNote\fR
181 .PP
182 This is the account option implementation that's used 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.
183 .PP
184 The following options are recognized by the various Courier packages:
185 .sp
186 .it 1 an-trap
187 .nr an-no-space-flag 1
188 .nr an-break-flag 1
189 .br
190 \fBNote\fR
191 .PP
192 The application is responsible for enforcing all the
193 \(lqdisabled\(rq
194 option. An authentication request for service
195 \(lqimap\(rq, for example, will succeed provided that the userid and the password are valid, even if
196 \(lqdisableimap=1\(rq
197 is set. The application's
198 \fBcallback_func\fR
199 should check for this condition, and return a negative return code.
200 .PP
201 disableimap=\fIn\fR
202 .RS 4
203 If "n" is 1, IMAP access to this account should be disabled.
204 .RE
205 .PP
206 disablepop3=\fIn\fR
207 .RS 4
208 If "n" is 1, POP3 access to this account should be disabled.
209 .RE
210 .PP
211 disablewebmail=\fIn\fR
212 .RS 4
213 If "n" is 1, webmail access to this account should be disabled.
214 .RE
215 .PP
216 disableshared=\fIn\fR
217 .RS 4
218 If "n" is 1, this account should not have access to shared folders or be able to share its own folders with other people.
219 .RE
220 .PP
221 group=\fIname\fR
222 .RS 4
223 This account is a member of access group
224 \fIname\fR. Instead of granting access rights on individual mail folders to individual accounts, the access rights can be granted to an access group
225 \(lqname\(rq, and all members of this group get the specified access rights.
226 .sp
227 The access group name
228 \(lqadministrators\(rq
229 is a reserved group. All accounts in the
230 administrators
231 group automatically receive all rights to all accessible folders.
232 .sp
233 .it 1 an-trap
234 .nr an-no-space-flag 1
235 .nr an-break-flag 1
236 .br
237 \fBNote\fR
238 This option may be specified multiple times to specify that the account belongs to multiple account groups.
239 .RE
240 .PP
241 sharedgroup=\fIname\fR
242 .RS 4
243 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's on top of whatever else the access control lists say). See the virtual shared folder documentation for more information.
244 .sp
245 For technical reasons, group names may not include comma, tab, "/" or "|" characters.
246 .RE
247 .SH "SEE ALSO"
248 .PP
249
250 \fI\fBauthlib\fR(3)\fR\&[1],
251 \fI\fBauth_generic\fR(3)\fR\&[2],
252 \fI\fBauth_login\fR(3)\fR\&[3],
253 \fI\fBauth_enumerate\fR(3)\fR\&[4],
254 \fI\fBauth_passwd\fR(3)\fR\&[5],
255 \fI\fBauth_getoption\fR(3)\fR\&[6].
256 .SH "REFERENCES"
257 .IP " 1." 4
258 \fBauthlib\fR(3)
259 .RS 4
260 \%authlib.html
261 .RE
262 .IP " 2." 4
263 \fBauth_generic\fR(3)
264 .RS 4
265 \%auth_generic.html
266 .RE
267 .IP " 3." 4
268 \fBauth_login\fR(3)
269 .RS 4
270 \%auth_login.html
271 .RE
272 .IP " 4." 4
273 \fBauth_enumerate\fR(3)
274 .RS 4
275 \%auth_enumerate.html
276 .RE
277 .IP " 5." 4
278 \fBauth_passwd\fR(3)
279 .RS 4
280 \%auth_passwd.html
281 .RE
282 .IP " 6." 4
283 \fBauth_getoption\fR(3)
284 .RS 4
285 \%auth_getoption.html
286 .RE