File: Setup-instructions

package info (click to toggle)
cyrus-imspd 1.8-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 3,928 kB
  • sloc: ansic: 15,729; sh: 2,200; makefile: 153
file content (338 lines) | stat: -rw-r--r-- 14,652 bytes parent folder | download | duplicates (3)
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
IMSP Version 1.7
----------------

Here's a crude set of directions for setting up the IMSP server.
There are several sections in this document:

- Setting it up
- Setting up LDAP address books
- Testing it
- Telemetry (logging user activity)
- Predefined options


SETTING IT UP
-------------
You have to create the directory /var/imsp, or change the "PREFIX"
definition in the syncdb.c file to an appropriate existing directory.

The cyrus-imspd must be run as root to use port 406. (But I think it
could be run out of inetd, so maybe that's no longer a true statement.)

You should copy the "options.sample" file to /var/imsp/options after
changing the site-specific lines as needed.  The parenthesized lists
in the options file are space separated. Binary options are set to "+"
for true and "-" for false. See the "Predefined options" section for a
list of options that control the IMSP server.

If you want new users to be able to LOGIN to the server, be sure the
"imsp.create.new.users" option is set to true (+). Without it, no one
can login until a directory and options file are created for them.

The AUTHENTICATE and LOGIN commands are implemented using SASL, so you
need to configure it as instructed by the directions that came with
the SASL libraries. That primarily involves putting SASL plug-ins into 
the /usr/lib/sasl/ directory. Also check the "imsp.sasl.*" options
that are documented in "Predefined options" section below.

If you're using Kerberos you need to create an "imap.<short-host>"
Kerberos instance where <short-host> is the first element of the
fully qualified domain name (ex: imap.cyrus for cyrus.andrew.cmu.edu).
Note that we use "imap", not "imsp", as the service name.

The IMAP proxy features of the IMSP server were never completed and
never used at any site that I'm aware of. Therefore, I decided to
remove those features rather than port them to the SASL environment.
The following paragraphs are kept around for history's sake.

   The CREATE/DELETE/RENAME and new user LOGIN commands do proxy
   connections to an IMAP server.  You need to make sure the
   "imap.new.mailbox.servers" option is correct for new user LOGIN to
   find a server to get a list of mailboxes from.  In addition, if your
   IMSP clients are using Kerberos tickets rather than plaintext
   passwords, you need to modify your IMAP server to accept the
   imap.<imsp-hostname> ticket as valid for any user.  AFS sites may need
   to start imspd after running pagsh to prevent ticket confusion, and
   other sites may need to modify the ticket file environment variable.

   If you are running a cyrus imap server, you can remove the file
   /var/imsp/mailboxes to cause an automatic re-sync of the mailbox list
   with the IMAP server the next time IMSP is restarted.  The mailbox
   commands will not work with a c-client IMAP server.

SETTING UP LDAP ADDRESS BOOKS
-----------------------------

The IMSP server now supports a special kind of read-only address book that's
implemented via LDAP lookups rather than the built-in syncdb database. The
"imsp.implementation.updates" file has more details on our motivations for
adding this ability to the server, so this document will just talk about
setting it up.

In the initial implementation, the IMSP server can only perform lookups
through one LDAP server using one set of search options. The server name and
other LDAP settings are retrieved from the IMSP global options file
whenever they are first needed. (You don't need to provide any settings if
you're not going to use the LDAP feature.)

The LDAP server name and search base settings are defined in the following
global options. In /var/imsp/options, replace the values as appropriate for
your site. Omit the "ldapport" setting to have it default to the standard
LDAP port number. The "scope" setting must be one of "subtree", "base", or
"onelevel"; see the LDAP documentation on ldap_search() for more info.

	imsp.ldap.searchbase N o=Carnegie Mellon University
	imsp.ldap.scope N subtree
	imsp.ldap.host N ldap.andrew.cmu.edu
	imsp.ldap.port N 389

Next, fill in the name of the LDAP attribute that contains the full name of
the entry. This is normally "cn", short for common name. The server also
needs the name of an attribute which is sure to be unique for each entry. At
Carnegie Mellon, more than one user can have the same common name but we
know that no two entries will have the same "uid" user-id field. In
the worst case, you could always use "dn", the distinguished name of
the entry. Try to pick something shorter, though.

	imsp.ldap.fullnameattr N cn
	imsp.ldap.uniqueattr N uid

Now define a default filter for the search operations. Generally, this
should help narrow the search down to entries which correspond to people or
at least entries which have e-mail addresses. The value you see below is
specific to Carnegie Mellon, so make sure you change it. Something like
"mail=*" would limit the search to those entries that have an e-mail
attribute. If you don't want to restrict the search at all, use
"(objectclass=*)", the LDAP equivalent of an unqualified wildcard search.

	imsp.ldap.defaultfilter N (objectclass=cmuwhitepages)

Finally, you must provide a mapping table to translate between IMSP field
names and LDAP attribute names. They are entered as a simple list but are
interpreted as (field-name, ldap-attribute-name) pairs. Obviously, there
must be an even number of items in the list. If an IMSP field name has no
corresponding LDAP attribute, use NULL as the corresponding attribute name.

The values suggested below are tuned to Cyrusoft's Mulberry e-mail
client. The IMSP fields you see listed are exactly what Mulberry uses when
storing its address books. Pay particular attention to the "alias" field
since that is the one used when Mulberry 1.4 or later does nickname
resolution on addresses entered in the "To" header of outgoing message
drafts. We use "uid" so Andrew user-ids are automatically expanded to the
full name and preferred e-mail address of the user.

This should appear as one long line in your options file, but has been
broken up here for readability:

	  imsp.ldap.attrmap N (name cn address postaladdress alias uid
	  company ou email mail fax telephonenumber notes NULL phone-home
	  telephonenumber phone-work telephonenumber urls labeleduri)

When compiling the server for your site, make sure that the configure
script finds your LDAP library. Use the --with-ldap=<library-name> argument
if you need to help it out. For example, "--with-ldap=superldap" results in
"-lsuperldap" at link time. If configure doesn't find an LDAP library or
you use "--without-ldap", all the LDAP lookup features are omitted.
(abook_ldap.c is not even compiled.)

The remaining set up steps are done by sending commands to the running IMSP
server. The "imtest" program is a simple way of interacting with your IMSP
server. See below for more information. You might find that 
"telnet imsp.company.com 406" will also do the job if you're comfortable
authenticating with the 'A LOGIN user "password"' command first.

Decide which address books should use LDAP lookups. If necessary, create
the address book first with the protocol:

  A0 CREATEADDRESSBOOK "All Users"

If the address book already exists and isn't empty, that's okay. Once the
LDAP feature is enabled, the old contents of the address book are
ignored.

Turn on the LDAP feature for the address book by setting the USER1 access
control list (ACL) bit for all users. By setting the USER1 bit, the server
will automatically remove all normal access bits other than READ and
LOOKUP, making this a read-only address book.

If you don't want users to be able to open the address book, also set the
USER0 bit. This is strongly recommended as producing a list of each user in
the address book can be an expensive operation when the list of users ranges
in the tens of thousands. When USER0 is set, users can still search for
specific entries -- they're just restricted from doing an unqualified
search. The protocol for this is ('0' stands for USER0 and '1' stands for
USER1):

  A1 SETACL ADDRESSBOOK "All Users" anyone lr01

As a quick test of your LDAP-based address book, try a simple search:

  A2 SEARCHADDRESS "All Users" name "*jackson*"

If you don't get the results you expected, check the syslog log file for
error messages.


TESTING IT
----------

The test program "imtest" included with the Cyrus IMAP release is a
simple protocol tester.  It connects to the IMSP or IMAP server
specified on the command line, line-buffers user input and sends it to
the server as well as displaying server responses locally.  It will
convert all newlines to CRLF pairs.  It also has SASL integration, so
it can let you test authenticated server logins. See the documentation
that comes with "imtest" for more details on using the tool.


TELEMETRY (LOGGING USER ACTIVITY)
---------------------------------

If you wish to save session telemetry on the server, create the
directory "/var/imsp/log/<user>".  All connections by <user> will
store a telemetry log in that directory.


PREDEFINED OPTIONS
------------------

The following option names are reserved in this implementation. Some
of the options have been deprecated by the removal of the IMAP
integration (mailbox and bboard) features or by the conversion to the
SASL authentication infrastructure. Those options are prefixed with
the word "OLD" in the list below.

imsp.sasl.allowplaintext	[NON-VISIBLE]
	Binary option to decide whether users are allowed to
	AUTHENTICATE with the plaintext	mechanism. Even if this option 
	is turned off, the LOGIN command will accept the equivalent of 
	plain text authentications. (Should that be changed?)

imsp.sasl.minimum_ssf		[NON-VISIBLE]
	Determines the minimum security strength factor required
	before the server will advertise and accept a given
	mechanism. Measured in bits. If the client doesn't support a
	mechanism with at least this many bits of "strength",
	authentication will fail.

imsp.sasl.maximum_ssf		[NON-VISIBLE]
	Determines the maximum security strength factor allowed for
	the server will advertise and accept a given mechanism. See above.

imsp.sasl.<plug-in>.*
	Each SASL plug-in may choose to support optional or required
	mechanism settings. When the mechanism requests an option
	lookup, the IMSP server prepends the string "imsp.sasl." and
	the lowercased name of the mechanism to the name of the option 
	being sought.
	Example: imsp.sasl.kerberos_v4.srvtab

common.date			[READ-ONLY] (magic)
	When a user asks for the value of the date option, an RFC-822
	date string should be returned with the current time.  This is
	provided to assist small clients with unreliable clocks.

common.delivery.hosts		[READ-ONLY]
	This contains the list of recommended SMTP hosts for mail delivery.

common.domain			[READ-ONLY]
	When a user asks for the domain option, the local mail domain
	is returned.

common.from			[READ-ONLY] (magic)
	When a user asks for the value of the from option, an RFC-822
	address for that user is returned.

common.sent.mailbox		[READ-WRITE]
	The name of a mailbox to APPEND blind carbon copies.

imsp.admin.all			[NON-VISIBLE]
	This is a list of users that may use any implemented IMSP features.

OLD imsp.admin.bboards		[NON-VISIBLE]
	This is a list of users that may create, rename, delete and
	replace any mailbox.

OLD imsp.admin.subs		[NON-VISIBLE]
	This is a list of users allowed to view (but not change) other
	user's subscriptions and mailboxes.

imsp.create.new.users		[NON-VISIBLE]
	If this global option is on, the directory for a new user
	will be created automatically.  Otherwise the system
	administrator must create a directory for each authorized user.

imsp.create.policy		[NON-VISIBLE]
	This is specifies the creation policy for new mailboxes.  The
	option is specified as a site-defined string.

OLD imsp.default.subs		[NON-VISIBLE]
	A list of the default subscriptions given to a new user.

OLD imsp.external.subs		[NON-VISIBLE]
	If this is set, subscriptions to external mailboxes and
	mailboxes are allowed by using the {hostname}folder notation.

OLD imsp.imap.servers		[READ-ONLY]
	This global option contains a list of all IMAP servers managed
	by IMSP.  An implementation specifier may be appended to the
        end of a server name with a `/' separator.

imsp.ldap.*                     [NON-VISIBLE]
	See the section above for more information on all the LDAP settings.

imsp.log.level			[NON-VISIBLE]
	This integer specifies the amount of logging to be done.

imsp.login.realms		[NON-VISIBLE]
	This specifies a list of realms which are permitted to do
	cross-realm Kerberos authentication.

imsp.login.srvtab		[NON-VISIBLE]
	This specifies the filename of the Kerberos srvtab file.
	Still supported for backward compatibility, but you should
	probably use imsp.sasl.kerberos_v4.srvtab instead.

OLD imsp.new.mailbox.servers	[NON-VISIBLE]
	This specifies a list of IMAP servers to search for or create
	the INBOX for a new user, or new non-personal mailboxes.

OLD imsp.proxy.authlevel	[NON-VISIBLE]
	This is an integer bitmask of the authentication levels
	supported for proxy login to IMAP servers.  Add 1 if cleartext
	permitted, add 2 if integrity permitted, add 4 if privacy
	permitted.  Defaults to 7.  The highest permitted mechanism
	available will be used.

OLD imsp.proxy.authtype		[NON-VISIBLE]
	This is the authentication type used for proxy login
	to IMAP servers.  If this is not set, the best authentication
	available will be used.  Only KERBEROS_V4 and PLAINTEXT
	supported at present.

OLD imsp.required.subs		[NON-VISIBLE]
	Users will not be allowed to unsubscribe to mailboxes in this
	list.

OLD imsp.share.mailboxes	[NON-VISIBLE]
	If this global option is on, then mailbox names beginning with
	the prefix "user.<username>." are reserved as mappings of
	individual user's MAILBOXES into the MAILBOXES namespace.  In
	addition, it permits users to allow other users to read their
	mailboxes if ACLs permit.

OLD imsp.user.inbox		[READ-ONLY]
	This is the name of a mailbox which will appear as "INBOX" on any
        mailbox list.  The phrase "$USER" will be replaced with the login
        name of the current user.

imsp.user.quota			[READ-ONLY]
	This is an integer specifying the maximum number of kilobytes
	in the user's options & address books (doesn't include
	subscriptions or address book ACLs).

imsp.user.quota.usage		[READ-ONLY]
	This is an integer specifying the number of bytes used by
	options and address book entries (see "QUOTA" above for full
	details).  Its value is translated to kilobytes for user
	requests.