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 using address. if this field is NULL, get the userid and the groupid from sysuserid and sysgroupid instead.
  • sysuserid β€” sysuserid may be NULL if sysusername is initialized; otherwise it's a pointer to the account's numeric userid. πŸ”’
  • sysgroupid β€” the account's numeric groupid. sysgroupid is only used when sysusername is NULL.
  • fullname β€” the account's full name. this one's optional, it may be NULL. 🫢
  • homedir β€” the account's home directory. this field cannot be NULL. 🏠
  • maildir β€” the pathname to the account's mailbox. optional! it can be NULL, in which case the default location is assumed. πŸ“¬
  • quota β€” optional maildir quota on the account's mailbox (and NULL if 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 to NULL. 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 to NULL. πŸ™ˆ
  • 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's callback_func should 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" is 1, IMAP access to this account should be disabled. 🚫
  • disablepop3=n β€” if "n" is 1, POP3 access to this account should be disabled. 🚫
  • disableinsecureimap=n β€” if "n" is 1, unencrypted IMAP access to this account should be disabled. πŸ”“πŸš«
  • disableinsecurepop3=n β€” if "n" is 1, unencrypted POP3 access to this account should be disabled. πŸ”“πŸš«
  • disablewebmail=n β€” if "n" is 1, webmail access to this account should be disabled. 🌐🚫
  • disableshared=n β€” if "n" is 1, 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 group name. 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 πŸ“

  1. auth_meta_init_default(3) https://www.courier-mta.org/authlib/auth_meta.html
  2. authlib(3) https://www.courier-mta.org/authlib/authlib.html
  3. auth_generic_meta(3) https://www.courier-mta.org/authlib/auth_generic.html
  4. auth_getuserinfo_meta(3) https://www.courier-mta.org/authlib/auth_getuserinfo.html
  5. auth_enumerate(3) https://www.courier-mta.org/authlib/auth_enumerate.html
  6. auth_passwd(3) https://www.courier-mta.org/authlib/auth_passwd.html
  7. auth_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