AUTH_LOGIN_META(3)
π AUTH_LOGIN_META π
okay bestie, welcome to AUTH_LOGIN_META(3) β the Courier courierauth page about checking a userid + password. yes it's the third section of the manual, yes it's a whole vibe, and yes we're reading all of it together, no skipping. π¦
β¨ NAME β¨
auth_login_meta, auth_login β validate a userid and password π
πΈ SYNOPSIS πΈ
#include <courierauth.h>
int rc=auth_login_meta(struct auth_meta *meta, const char *service,
const char *userid, const char *password,
int (*callback_func)(struct authinfo *, void *),
void *callback_arg);
int rc=auth_login(const char *service, const char *userid,
const char *password,
int (*callback_func)(struct authinfo *, void *),
void *callback_arg);
π DESCRIPTION π
so auth_login_meta does the whole "does this userid actually exist, and is its password correct" thing. π
service is the so-called "service" being authenticated β think βimapβ or βpop3β. and ngl, service may or may not even be used by whatever back-end module the Courier authentication library has configured. it's giving "depends on your setup" energy. π
a NULL meta is literally equivalent to using the default auth_meta that auth_meta_init_default(3)[1] hands back.
π¨ auth_login() is deprecated and should not be used in new code. periodt.
π RETURNS π
here's the tea β: callback_func gets invoked if auth_login succeeds, and callback_func's return value becomes the return value from auth_login (which should be 0, by convention β iconic, honestly).
callback_func will not be invoked if an error happens β that error is reported by a non-zero return value from auth_login. by convention:
- a positive return value means an internal, temporary failure, like the authentication daemon process not running π
- a negative return value means this request got processed, but it failed π
the second argument to callback_func is callback_arg, which this function does not interpret in any way whatsoever. no notes. the first argument is a pointer to this structure:
struct authinfo {
const char *sysusername;
const uid_t *sysuserid;
gid_t sysgroupid;
const char *homedir;
const char *address;
const char *fullname;
const char *maildir;
const char *quota;
const char *passwd;
const char *clearpasswd;
const char *options;
} ;
π§ Description of the above fields π§
addressβ the authenticated login ID. πsysusernameβ the authenticated account's userid and groupid can be looked up in the password file usingaddress. if this field isNULL, get the userid and the groupid fromsysuseridandsysgroupidinstead.sysuseridβsysuseridmay beNULLifsysusernameis initialized; otherwise it's a pointer to the account's numeric userid. π’sysgroupidβ the account's numeric groupid.sysgroupidis only used whensysusernameisNULL.fullnameβ the account's full name. this one's optional, it may beNULL. π«Άhomedirβ the account's home directory. this field cannot beNULL. πmaildirβ the pathname to the account's mailbox. optional! it can beNULL, in which case the default location is assumed. π¬quotaβ optional maildir quota on the account's mailbox (andNULLif no quota is set).passwdβ the account's encrypted password, if available. if the account has a cleartext password defined, this field can be set toNULL. the encrypted password can take several formats:- a traditional triple-DES crypted password, or a MD5+salt-hashed password, as used in Linux. π§
β{MD5}βfollowed by a base64-encoded MD5 hash of the password.β{SHA}βfollowed by a base64-encoded SHA1 hash of the password.
clearpasswdβ the account's cleartext password, if available. if the account has an encrypted password defined, this field can be set toNULL. πoptionsβ a comma-separated list of miscellaneous account options. see below for more info π
π Account options π
so depending on how the Courier authentication library is configured, accounts may have their own individual options attached. if the auth library config doesn't implement account options, the option string will just be a NULL value. otherwise it'll be a comma-separated list of βoption=valueβ settings. β¨
Note π«΅ the application is responsible for actually implementing the options. for example, an authentication request for serviceβimapβwill succeed provided that the userid and the password are valid β even ifβdisableimap=1βis set. the application'scallback_funcshould check for this condition, and return a negative return code. don't sleep on this one bestie.
Note π 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 info is obviously not applicable for a particular package. the inapplicable bits should be obvious. iykyk.
The following options are recognized by the various Courier packages:
disableimap=nβ if"n"is1, IMAP access to this account should be disabled. π«disablepop3=nβ if"n"is1, POP3 access to this account should be disabled. π«disableinsecureimap=nβ if"n"is1, unencrypted IMAP access to this account should be disabled. ππ«disableinsecurepop3=nβ if"n"is1, unencrypted POP3 access to this account should be disabled. ππ«disablewebmail=nβ if"n"is1, webmail access to this account should be disabled. ππ«disableshared=nβ if"n"is1, this account should not have access to shared folders, and shouldn't be able to share its own folders with other people either. π€π«group=nameβ this option is used by Courier-IMAP when calculating access control lists. it places the account as a member of access groupname. instead of granting access rights on individual mail folders to individual accounts, the access rights can be granted to an access groupβnameβ, and all members of this group get the specified access rights. the access group nameβadministratorsβis a reserved group. all accounts in the administrators group automatically receive all rights to all accessible folders. π
Note π this option may be specified multiple times to say that the account belongs to multiple account groups.
sharedgroup=nameβ another option used by Courier-IMAP. it appends"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 info. π for technical reasons, group names may not include comma, tab,"/"or"|"characters. β οΈ
π SEE ALSO π
authlib(3)[2], auth_meta(3)[1], auth_generic_meta(3)[3], auth_getuserinfo_meta(3)[4], auth_enumerate(3)[5], auth_passwd(3)[6], auth_getoption(3)[7].
π NOTES π
auth_meta_init_default(3)https://www.courier-mta.org/authlib/auth_meta.htmlauthlib(3)https://www.courier-mta.org/authlib/authlib.htmlauth_generic_meta(3)https://www.courier-mta.org/authlib/auth_generic.htmlauth_getuserinfo_meta(3)https://www.courier-mta.org/authlib/auth_getuserinfo.htmlauth_enumerate(3)https://www.courier-mta.org/authlib/auth_enumerate.htmlauth_passwd(3)https://www.courier-mta.org/authlib/auth_passwd.htmlauth_getoption(3)https://www.courier-mta.org/authlib/auth_getoption.html
and that's the whole page bestie, we ate and left no crumbs π this one was written by S. Varshavchik. and the version we're looking at is dated 01/11/2026 β mwah, go validate some passwords responsibly π β¨
π¦ where this page comes from
- ubuntu stonking: courier-authlib-dev 0.73.1-2ubuntu1 Β· GPL-3+~with-OpenSSL-exception
- Copyright 2004-2020 S. Varshavchik. See COPYING for -->
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms