1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
.TH s/qmail: qmail-pw2u 8
.SH NAME
qmail-pw2u \- build address assignments from a passwd file
.SH SYNOPSIS
.B qmail-pw2u
[
.B \-/ohHuUC
]
[
.B \-c\fIchar
]
.SH DESCRIPTION
.B qmail-pw2u
reads a V7-format passwd file from standard input
and prints a
.BR qmail-users -format
assignment file.
A V7-format passwd file is a series of lines.
Each line has the format
.EX
user:password:uid:gid:gecos:home:shell
.EE
where
.I user
is an account name,
.I uid
and
.I gid
are the user id and group id of that account,
and
.I home
is the account's home directory.
.IR password ,
.IR gecos ,
and
.I shell
are ignored by
.BR qmail-pw2u .
If you put the output of
.B qmail-pw2u
into
.BR SQMAIL/users/assign ,
and then run
.BR qmail-newu ,
.B qmail-lspawn
will obey the assignments printed by
.BR qmail-pw2u .
.B WARNING:
After changing any users, uids, gids, or home directories
in your passwd file,
you must run
.B qmail-pw2u
and
.B qmail-newu
again if you want
.B qmail-lspawn
to see the changes.
.SH RULES
By default,
.B qmail-pw2u
follows the same rules as
.BR qmail-getpw .
It skips
.I user
if (1)
.I uid
is zero,
(2)
.I home
does not exist,
(3)
.I user
does not own
.IR home ,
or
(4)
.I user
contains uppercase letters.
It then gives each remaining
.I user
control over the basic
.I user
address and
all addresses of the form
.IR user\fBBREAK\fIanything .
A catch-all user,
.BR alias ,
controls all other addresses.
You may change these rules by setting up files in
.BR SQMAIL/users :
.TP
.B include
Allowed users, one per line.
If
.B include
exists, and
.I user
is not listed in
.BR include ,
.I user
is ignored.
.TP
.B exclude
Ignored users, one per line.
If
.B exclude
exists, and
.I user
is listed in
.BR exclude ,
.I user
is ignored.
.TP
.B mailnames
Replacement names for users.
Each line has the form
.EX
user:mailname1:mailname2:...
.EE
The addresses
.I mailname1
and
.I mailname1\fBBREAK\fIext
and
.I mailname2
and so on will be delivered
to
.IR user .
.B WARNING:
The addresses
.I user
and
.I user\fBBREAK\fIext
will not be delivered to
.I user
unless
.I user
is listed as one of the
.IR mailname s.
A line in
.B mailnames
is silently ignored if the user does not exist.
.TP
.B subusers
Extra addresses.
Each line has the form
.EX
sub:user:pre:
.EE
.I sub
will be handled by
.IR home\fB/.qmail\-\fIpre ,
where
.I home
is
.IR user 's
home directory;
.I sub\fBBREAK\fIext
will be handled by
.IR home\fB/.qmail\-\fIpre\fB\-\fIext .
.TP
.B append
Extra assignments,
printed at the end of
.BR qmail-pw2u 's
output.
.SH OPTIONS
.TP
.B \-o
(Default.)
Skip
.I user
if
.I home
does not exist (or is not visible to
.BR qmail-pw2u ).
Skip
.I user
if
.I home
is not owned by
.IR user .
.TP
.B \-h
Stop if
.I home
does not exist.
This is appropriate if every user is supposed to have a home directory.
Skip
.I user
if
.I home
is not owned by
.IR user .
.TP
.B \-H
Do not check the existence or ownership of
.IR home .
.TP
.B \-U
(Default.)
Skip
.I user
if there are any uppercase letters in
.IR user .
.TP
.B \-u
Allow uppercase letters in
.IR user .
.TP
.B \-c\fIchar
Use
.I char
as the user-extension delimiter
in place of
.BR BREAK .
.TP
.B \-C
Disable the user-extension mechanism.
.TP
.B \-/
Use
.IR home\fB/.qmail\-/ ...
instead of
.IR home\fB/.qmail\- ...
.SH "SEE ALSO"
qmail-users(5),
qmail-lspawn(8),
qmail-newu(8),
qmail-getpw(8)
|