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