diff options
Diffstat (limited to 'doc/mailfromd.texi')
-rw-r--r-- | doc/mailfromd.texi | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 86f4d845..60af5b07 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -243,6 +243,7 @@ Built-in and Library Functions * Database functions:: * I/O functions:: * System functions:: +* Passwd functions:: * Sieve Interface:: * Interfaces to Third-Party Programs:: * Rate limiting functions:: @@ -5886,6 +5887,7 @@ in version @value{VERSION}. * Database functions:: * I/O functions:: * System functions:: +* Passwd functions:: * Sieve Interface:: * Interfaces to Third-Party Programs:: * Rate limiting functions:: @@ -8022,6 +8024,50 @@ Set the umask to @var{mask} & 0777. Return the previous value of the mask. @end deftypefn +@node Passwd functions +@subsubsection System User Database + +@deftypefn {Built-in Function} string getpwnam (string @var{name}) +@deftypefnx {Built-in Function} string getpwuid (number @var{uid}) +Look for the user @var{name} (@code{getpwnam}) or user ID @var{uid} +(@code{getpwuid}) in the system password database and return the +corresponding record, if found. If not found, raise the +@samp{e_not_found} exception. + +The returned record consists of six fields, separated by colon sign: + +@smallexample +uname:passwd:uid:gid:gecos:dir:shell +@end smallexample + +@multitable @columnfractions 0.3 0.6 +@headitem Field @tab Meaning +@item uname @tab user name +@item passwd @tab user password +@item uid @tab user ID +@item gid @tab group ID +@item gecos @tab real name +@item dir @tab home directory +@item shell @tab shell program +@end multitable + +For example: + +@smallexample +getpwnam("gray") +@result{} "gray:x:1000:1000:Sergey Poznyakoff:/home/gray:/bin/bash" +@end smallexample +@end deftypefn + +Following two functions can be used to test for existence of a key in +the user database: + +@deftypefn {Built-in Function} boolean mappwnam (string @var{name}) +@deftypefnx {Built-in Function} boolean mappwuid (number @var{uid}) +Return @samp{true} if @var{name} (or @var{uid}) is found in the system +user database. +@end deftypefn + @node Sieve Interface @subsubsection Sieve Interface @cindex Sieve |