authenticate/checkvpw.html
author "Tomas Zeman <tzeman@volny.cz>"
Wed, 16 Jan 2008 22:39:43 +0100
changeset 0 6f7a81934006
child 2 b3afb9f1e801
permissions -rw-r--r--
Imported vmailmgr-0.96.9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     1
<HTML>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     2
<HEAD>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     3
<TITLE>checkvpw - check passwords for virtual and non-virtual users</TITLE>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     4
<LINK REV="made" HREF="mailto:root@porky.devel.redhat.com">
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     5
</HEAD>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     6
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     7
<BODY>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     8
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
     9
<!-- INDEX BEGIN -->
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    10
<!--
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    11
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    12
<UL>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    13
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    14
	<LI><A HREF="#NAME">NAME</A>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    15
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    16
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    17
	<LI><A HREF="#RETURN_VALUE">RETURN VALUE</A>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    18
	<LI><A HREF="#ENVIRONMENT">ENVIRONMENT</A>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    19
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    20
	<LI><A HREF="#AUTHOR">AUTHOR</A>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    21
</UL>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    22
-->
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    23
<!-- INDEX END -->
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    24
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    25
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    26
<H1><A NAME="NAME">NAME</A></H1>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    27
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    28
checkvpw - check passwords for virtual and non-virtual users
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    29
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    30
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    31
<HR>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    32
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    33
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    34
<STRONG>checkvpw</STRONG>  <STRONG>subprogram</STRONG> [<STRONG>arguments...</STRONG>]
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    35
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    36
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    37
<HR>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    38
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    39
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    40
This program is a drop-in replacement for the standard checkpassword,
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    41
written by D. J. Bernstein (<A
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    42
HREF="mailto:djb@pobox.com">djb@pobox.com</A>) In the absence of virtual
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    43
hosting (determined by the use of
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    44
<EM>/var/qmail/control/virtualdomainss</EM> and IP aliases), it behaves identically to checkpassword. When virtual
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    45
hosting is used, it permits logins from a unique set of users for each of
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    46
the aliases.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    47
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    48
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    49
<EM>checkvpw</EM> must be run from either the <EM>tcp-env</EM> program (part of the <EM>qmail</EM>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    50
package) or from a suitable substitute, such as <EM>tcpserver</EM>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    51
(part of the <EM>ucspi-tcp</EM> package). These packages are used to determine to which address a remote
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    52
host is connecting.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    53
<EM>checkvpw</EM> must also be passed the checkpassword-compatible authentication data on
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    54
file descriptor three. This can be accomplished by running it from a tool
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    55
such as
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    56
<EM>qmail-popup</EM>.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    57
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    58
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    59
<EM>checkvpw</EM> accepts a command line in the following format:
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    60
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    61
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    62
<PRE>        checkvpw [subprogram] [arguments...]
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    63
</PRE>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    64
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    65
If the authentication information is valid, the subprogram is run,
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    66
otherwise <EM>checkvpw</EM> returns an error to the program that invokes it.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    67
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    68
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    69
If the user name contains the character <CODE>@</CODE>, the host name reported by <EM>tcp-env</EM> is replaced by the string following the
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    70
<CODE>@</CODE>, and the user name is replaced by the string preceding the
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    71
<CODE>@</CODE>. If the local host name reported by <EM>tcp-env</EM> matches one of those in <EM>/var/qmail/control/virtualdomains</EM>, <EM>checkvpw</EM> prepends the
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    72
<EM>prepend</EM> string associated with the host name to the given user name. Wildcards in <EM>virtualdomains</EM> are permitted and are handled in the same way <EM>qmail</EM> handles them (see <EM>qmail-send</EM>). For example, if the line <CODE>.bar.com:bar</CODE> appears in the virtual hosts file, it matches <CODE>one.two.bar.com</CODE> but not <CODE>bar.com</CODE>.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    73
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    74
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    75
If the user name resulting from the above step appears in the system
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    76
password file (typically <EM>/etc/passwd</EM>), the user is treated as a local user and authenticated with the
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    77
information from that file. If this authentication succeeds, the mail
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    78
directory is set to the subdirectory named on the command line. If the user
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    79
name does not appear in the system password file and is of the form <CODE>name-ext</CODE> where <CODE>name</CODE> does appear in the password file, the user is treated as a ``virtual'' user
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    80
and authenticated with the information from a file named <EM>passwd</EM> in the user's home directory. If this authentication succeeds, the mail
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    81
directory is set to the subdirectory <EM>users/ext/</EM> in the user's home directory, where
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    82
<CODE>ext</CODE> is from the above step.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    83
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    84
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    85
<EM>checkvpw</EM> also does some rewriting on the arguments of the subprogram. Any argument
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    86
matching the string ``<CODE>maildir</CODE>'' (ignoring case) is replaced with the full path of the mail directory, as
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    87
determined by the steps above.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    88
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    89
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    90
This program may be invoked in combination with <EM>qmail-popup</EM> and
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    91
<EM>qmail-pop3d</EM> from inetd by placing the following line in the
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    92
<EM>/etc/inetd.conf</EM> configuration file (all one line):
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    93
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    94
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    95
<PRE>        pop-3 stream tcp nowait root /var/qmail/bin/tcp-env tcp-env -R /var/qmail/bin/qmail-popup &lt;hostname&gt; /usr/bin/checkvpw /var/qmail/bin/qmail-pop3d Maildir/
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    96
</PRE>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    97
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    98
<HR>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
    99
<H1><A NAME="RETURN_VALUE">RETURN VALUE</A></H1>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   100
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   101
0 if the user is successfully authenticated, nonzero if any error occurred.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   102
Exit code 1 indicates that a bad password was given, 2 indicates that the
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   103
program was used incorrectly, and 111 indicates a temporary failure.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   104
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   105
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   106
<HR>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   107
<H1><A NAME="ENVIRONMENT">ENVIRONMENT</A></H1>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   108
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   109
<EM>checkvpw</EM> requires that <CODE>TCPLOCALHOST</CODE> be set to the host name of the local address of the connection.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   110
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   111
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   112
<HR>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   113
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   114
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   115
<CODE>vdeliver(1)</CODE>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   116
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   117
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   118
<HR>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   119
<H1><A NAME="AUTHOR">AUTHOR</A></H1>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   120
<P>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   121
Bruce Guenter &lt;<EM>bruceg@em.ca</EM>&gt;.
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   122
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   123
</BODY>
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   124
6f7a81934006 Imported vmailmgr-0.96.9
"Tomas Zeman <tzeman@volny.cz>"
parents:
diff changeset
   125
</HTML>