2 .\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3 .\" <!-- distribution information. -->
4 .\" Title: auth_generic
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_GENERIC" "3" "06/20/2015" "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_generic \- Generic authentication request
37 #include <courierauth\&.h>
39 .HP \w'int\ rc=auth_generic('u
40 .BI "int rc=auth_generic(const\ char\ *" "service" ", const\ char\ *" "authtype" ", const\ char\ *" "authdata" ", int\ " "(*callback_func)" "\ (struct\ authinfo\ *,\ void\ *), void\ *" "callback_arg" ");"
44 processes a generic authentication request\&. You do not want to use this function\&. You really want to use
45 \m[blue]\fB\fBauth_login\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2\&.
47 specifies which so\-called "service" is being authenticated; like
52 may or may not be used by the Courier authentication library\*(Aqs configured back\-end module\&.
55 specifies the format of the authentication request\&. Three authentication formats are defined in
61 contains the following string:
62 \(lq\fIuserid\fR\en\fIpassword\fR\en\(rq\&. That is, the userid being authenticated, an
64 newline character, the password, and a second newline character\&.
67 AUTHTYPE_CRAMMD5 or AUTHTYPE_CRAMSHA1
69 This format is used with
74 contains the following string:
75 \(lq\fIchallenge\fR\en\fIresponse\fR\en\(rq\&.
77 is the base64\-encoded challenge, which is followed by an
81 is a base64\-encoded string that\*(Aqs followed by a second newline character\&. The base64\-encoded string consists of the responding userid, a space character, then the response to the challenge expressed as hexadecimal digits\&.
89 \fBcallback_func\fR\*(Aqs return value becomes the return value from
91 (which should be 0, by convention)\&.
93 will not be invoked if an error occurs, which is reported by a non\-zero return value from
94 \fBauth_generic\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\&.
96 The second argument to
99 \fBcallback_arg\fR, which is not interpreted by this function in any way\&. The first argument will be a pointer to the following structure:
101 \fBExample\ \&1.\ \&struct authinfo\fR
108 const char *sysusername;
109 const uid_t *sysuserid;
114 const char *fullname;
118 const char *clearpasswd;
128 Description of the above fields:
132 The authenticated login ID\&.
137 The authenticated account\*(Aqs userid and groupid can be looked up in the password file using
138 address\&. If this field is
139 NULL, obtain the userid and the groupid from
152 is initialized, otherwise it\*(Aqs a pointer to the account\*(Aqs numeric userid\&.
157 Account\*(Aqs numeric groupid\&.
167 This is the account\*(Aqs full name\&. This field is optional, it may be
173 The account\*(Aqs home directory\&. This field cannot be
179 The pathname to the account\*(Aqs mailbox\&. This field is optional, it can be
181 in which case the default location is assumed\&.
186 Optional maildir quota on the account\*(Aqs mailbox (and
188 if no quota is set)\&.
193 The account\*(Aqs encrypted password, if available\&. If the account has a cleartext password defined, this field can be set to
194 NULL\&. The encrypted password can take several formats:
204 A traditional triple\-DES crypted password, or a MD5+salt\-hashed password, as used in Linux\&.
216 followed by a base64\-encoded MD5 hash of the password\&.
228 followed by a base64\-encoded SHA1 hash of the password\&.
234 The account\*(Aqs cleartext password, if available\&. If the account has an encrypted password defined, this field can be set to
240 A comma\-separated list of miscellaneous account options\&. See below for more information\&.
242 .SS "Account options"
244 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
246 value\&. Otherwise it will be a comma\-separated list of
247 \(lq\fIoption\fR=\fIvalue\fR\(rq
254 .nr an-no-space-flag 1
262 The application is responsible for actually implementing the options\&. For example, sn authentication request for service
263 \(lqimap\(rq, for example, will succeed provided that the userid and the password are valid, even if
264 \(lqdisableimap=1\(rq
265 is set\&. The application\*(Aqs
267 should check for this condition, and return a negative return code\&.
275 .nr an-no-space-flag 1
283 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\&.
287 The following options are recognized by the various Courier packages:
291 If "n" is 1, IMAP access to this account should be disabled\&.
296 If "n" is 1, POP3 access to this account should be disabled\&.
299 disableinsecureimap=\fIn\fR
301 If "n" is 1, unencrypted IMAP access to this account should be disabled\&.
304 disableinsecurepop3=\fIn\fR
306 If "n" is 1, unencrypted POP3 access to this account should be disabled\&.
309 disablewebmail=\fIn\fR
311 If "n" is 1, webmail access to this account should be disabled\&.
314 disableshared=\fIn\fR
316 If "n" is 1, this account should not have access to shared folders or be able to share its own folders with other people\&.
321 This option is used by Courier\-IMAP in calculating access control lists\&. This option places the account as a member of access group
322 \fIname\fR\&. Instead of granting access rights on individual mail folders to individual accounts, the access rights can be granted to an access group
323 \(lqname\(rq, and all members of this group get the specified access rights\&.
325 The access group name
326 \(lqadministrators\(rq
327 is a reserved group\&. All accounts in the
329 group automatically receive all rights to all accessible folders\&.
335 .nr an-no-space-flag 1
342 This option may be specified multiple times to specify that the account belongs to multiple account groups\&.
347 sharedgroup=\fIname\fR
349 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\&.
351 For technical reasons, group names may not include comma, tab, "/" or "|" characters\&.
355 \m[blue]\fB\fBauthlib\fR(3)\fR\m[]\&\s-2\u[2]\d\s+2,
356 \m[blue]\fB\fBauth_login\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2,
357 \m[blue]\fB\fBauth_getuserinfo\fR(3)\fR\m[]\&\s-2\u[3]\d\s+2,
358 \m[blue]\fB\fBauth_enumerate\fR(3)\fR\m[]\&\s-2\u[4]\d\s+2,
359 \m[blue]\fB\fBauth_passwd\fR(3)\fR\m[]\&\s-2\u[5]\d\s+2,
360 \m[blue]\fB\fBauth_getoption\fR(3)\fR\m[]\&\s-2\u[6]\d\s+2\&.
365 \%http://www.courier-mta.org/authlib/auth_login.html
370 \%http://www.courier-mta.org/authlib/authlib.html
373 \fBauth_getuserinfo\fR(3)
375 \%http://www.courier-mta.org/authlib/auth_getuserinfo.html
378 \fBauth_enumerate\fR(3)
380 \%http://www.courier-mta.org/authlib/auth_enumerate.html
385 \%http://www.courier-mta.org/authlib/auth_passwd.html
388 \fBauth_getoption\fR(3)
390 \%http://www.courier-mta.org/authlib/auth_getoption.html