diff -ruN cyrus-imapd/Makefile.in cyrus-imapd-2.0.15-HIERSEP-r2/Makefile.in --- cyrus-imapd/Makefile.in Sat Jul 7 20:54:14 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/Makefile.in Sun Jul 8 16:59:57 2001 @@ -1,5 +1,5 @@ # Top-level Makefile for cyrus software -# $Id: Makefile.in,v 1.48 2001/07/07 19:54:14 leg Exp $ +# $Id: Makefile.in,v 1.45.2.4.2.3 2001/07/08 15:59:57 ken3 Exp $ # # @configure_input@ # @@ -58,7 +58,7 @@ exec_prefix = @exec_prefix@ cyrus_prefix = @cyrus_prefix@ -VERSION = 2.0.15 +VERSION = 2.0.15-HIERSEP-r2 all:: @for d in $(SUBDIRS); \ @@ -88,7 +88,7 @@ if [ \! -d dist ]; then mkdir dist ; fi @echo "checking out the distribution" @cd dist ; cvs -Q -d :pserver:anoncvs@cvs.andrew.cmu.edu:/cvs \ - co -d cyrus-imapd-$(VERSION) cyrus + co -d cyrus-imapd-$(VERSION) -r hier-sep cyrus touch distcvs install:: diff -ruN cyrus-imapd/contrib/notify_unix/README cyrus-imapd-2.0.15-HIERSEP-r2/contrib/notify_unix/README --- cyrus-imapd/contrib/notify_unix/README Sat Jun 23 02:01:48 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/contrib/notify_unix/README Thu Jan 1 01:00:00 1970 @@ -1,17 +0,0 @@ -This directory contains two simple examples of UNIX notification daemons -written in Perl. Both daemons require installing the -Net::Server::Prefork module, located in this directory. - -The Perl script 'simple_notify.pl' simply logs mail notifications--it -shows the simplest possible handler. - -The Perl script 'mysql_notify.pl' also logs the notification, but in -addition it looks up the username in a DB table in order to get additional -information about the user. This could be used, for example, to get a -user's instant messaging address from a database in order to send a -notification message. 'mysql_notify.pl' requires a file /etc/notify -that contains three lines: the DSN, username, and password to connect -to the database. - -The shell script 'notify' is a sample init.d script for -starting/stopping the perl daemon. diff -ruN cyrus-imapd/doc/install-configure.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/install-configure.html --- cyrus-imapd/doc/install-configure.html Thu Jul 5 16:47:39 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/install-configure.html Sun Jul 8 16:59:58 2001 @@ -1,4 +1,4 @@ - + Configuring the IMAP Server @@ -89,7 +89,9 @@ them to receive mail, some problems will occur if admins are used as regular users. You also should <b>not</b> read mail as an administrator. You should have separate accounts for reading mail and -administrating. +administrating. This is especially true if using the +<tt>altnamespace</tt> option, because admins are <b>always</b> +presented with the standard (internal) namespace. <p><li>Create the configuration directory specified by the "<tt>configdirectory</tt>" option in "<tt>imapd.conf.</tt>" The @@ -408,5 +410,5 @@ name.</p> <P><HR> -last modified: $Date: 2001/07/05 15:47:39 $ +last modified: $Date: 2001/07/08 15:59:58 $ </BODY></HTML> diff -ruN cyrus-imapd/doc/install-perf.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/install-perf.html --- cyrus-imapd/doc/install-perf.html Tue May 1 03:00:07 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/install-perf.html Sun Jul 8 16:59:58 2001 @@ -1,4 +1,4 @@ -<!-- $Id: install-perf.html,v 1.2 2001/05/01 02:00:07 wcw Exp $ --> +<!-- $Id: install-perf.html,v 1.1.4.1.2.1 2001/07/08 15:59:58 ken3 Exp $ --> <HTML> <HEAD> <TITLE>Performance Notes @@ -64,7 +64,7 @@ </ul> <P><HR> -last modified: $Date: 2001/05/01 02:00:07 $ +last modified: $Date: 2001/07/08 15:59:58 $ </BODY></HTML> diff -ruN cyrus-imapd/doc/install.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/install.html --- cyrus-imapd/doc/install.html Mon Jul 2 17:11:34 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/install.html Sun Jul 8 16:59:58 2001 @@ -1,4 +1,4 @@ -<!-- $Id: install.html,v 1.6 2001/07/02 16:11:34 wcw Exp $ --> +<!-- $Id: install.html,v 1.5.6.1 2001/07/08 15:59:58 ken3 Exp $ --> <HTML> <HEAD> <TITLE>Installing and Configuring the Cyrus IMAP Server @@ -56,7 +56,7 @@


-last modified: $Date: 2001/07/02 16:11:34 $ +last modified: $Date: 2001/07/08 15:59:58 $
Return to the Cyrus IMAP Server Home Page diff -ruN cyrus-imapd/doc/man/arbitron.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/arbitron.8.html --- cyrus-imapd/doc/man/arbitron.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/arbitron.8.html Sun Jul 8 17:04:44 2001 @@ -0,0 +1,62 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+ + + + + + +

NAME

arbitron - arbitron mailboxes

+

SYNOPSIS

arbitron [ -C config-file ] [ -d days ] [ -p months ]
+mailbox...

+

DESCRIPTION

Arbitron collects and reports readership statistics for mailboxes on the server. It also optionally prunes the mail- boxes of \Seen state for dormant users.

+

Arbitron produces one line of output per mailbox, reporting the number of readers followed by a space and the name of the mailbox. IMPORTANT: This format is subject to change in future versions.

+

Each "reader" is a distinct authentication identity which has "s" rights to the mailbox and which has SELECTed the mailbox within the past days days. Users are not counted as reading their own personal mailboxes. Personal mailboxes are not reported unless there is at least one reader other than the mailboxes owner.

+

Arbitron reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

+ + + + + + + + + + + + + + + + +
+

-C config-file

+

-d days

+
+ +

Read configuration options from config-file.

+

Count as a reader an authentication identity which has SELECTed the mailbox within days days. Default is 30.

+
+

-p months

+
+ +

Prune \Seen state for users who have not SELECTed the mailbox within months months.
+Default is infinity.

+
+ + +
+
+

FILES

/etc/imapd.conf

+ diff -ruN cyrus-imapd/doc/man/collectnews.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/collectnews.8.html --- cyrus-imapd/doc/man/collectnews.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/collectnews.8.html Sun Jul 8 17:04:44 2001 @@ -0,0 +1,26 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+ + + + + + +

NAME

collectnews - add news articles to Cyrus header files

+

SYNOPSIS

collectnews [ -C config-file ]

+

DESCRIPTION

Collectnews reads article data from the standard input. It uses this information to update the files necessary for reading the articles through the Cyrus IMAP server. Collectnews is designed to be used by InterNetNews to update the IMAP database as the articles come in.

+

The input is processed as an INN overview stream written as a ``WR'' entry in the newsfeeds(5) file. This data consists of lines of text of the format newsgroup/article number, seperated by commas.

+

Collectnews reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. The optional newsprefix option specifies a prefix to be prepended to newsgroup names to make the corresponding IMAP mailbox names. The required partition-news option specifies the pathname prefix to the IMAP news mail- boxes. The value of partition-news concatenated with the dots-to-slashes-converted value of newsprefix must be the pathname of the news spool directory.

+

OPTIONS

-C config-file Read configuration options from config-file.

+

FILES

/etc/imapd.conf

+ diff -ruN cyrus-imapd/doc/man/ctl_deliver.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/ctl_deliver.8.html --- cyrus-imapd/doc/man/ctl_deliver.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/ctl_deliver.8.html Sun Jul 8 17:04:44 2001 @@ -0,0 +1,51 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

ctl_deliver - perform operations on the duplicate delivery database

+

SYNOPSIS

ctl_deliver [ -C config-file ] -r
+ctl_deliver
[ -C config-file ] -E days
+
ctl_deliver [ -C config-file ] -d -f filename

+

DESCRIPTION

Ctl_deliver is used to perform various administrative operations on the duplicate delivery database.

+

Ctl_deliver reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

+ + + + + + +
+

-C config-file

+

-r

+

-E days

+

-d

+

-f filename

+
+ +

Read configuration options from config-file.

+

Recover the database after an application or system failure.

+

Prune the database of entries older than days.

+

Dump the contents of the database to standard output in a portable flat-text format.

+

Use the database specified by filename.

+
+
+

FILES

/etc/imapd.conf

SEE ALSO

imapd.conf(5), master(8)
+

+ + diff -ruN cyrus-imapd/doc/man/ctl_mboxlist.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/ctl_mboxlist.8.html --- cyrus-imapd/doc/man/ctl_mboxlist.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/ctl_mboxlist.8.html Sun Jul 8 17:04:44 2001 @@ -0,0 +1,88 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

ctl_mboxlist - perform operations on the mailbox list database

+

SYNOPSIS

+ + + + + +
+

ctl_mboxlist [ -C config-file ] -r
+ctl_mboxlist
[ -C config-file ] -c
+ctl_mboxlist
[ -C config-file ] -d [ -f filename ] ctl_mboxlist [ -C config-file ] -u [ -f filename ]

+
+
+
+

DESCRIPTION

Ctl_mboxlist is used to perform various administrative operations on the mailbox list database.

+

Ctl_mboxlist reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. The configdirectory option is used to determine the default location of the mailbox list database.

+

OPTIONS

+ + + + + + + + + + + + + + + + + + + + + +
+

-C config-file

+

-r

+

-c

+
+ +

Read configuration options from config-file.

+

Recover the database after an application or system failure.

+

Checkpoint the database. Changes to the database which are part of committed transac- tions are written to disk.

+
+

-d

+

-u

+
+ +

Dump the contents of the database to standard output in a portable flat-text format.

+

Load the contents of the database from standard input. The input MUST be in the format output using the -d option.

+
+

-f filename

+
+ +

Use the database specified by filename instead of the default (configdirectory/mail-
+boxes.db
).

+
+ + +
+
+

FILES

/etc/imapd.conf

SEE ALSO

imapd.conf(5), master(8)
+

+ + diff -ruN cyrus-imapd/doc/man/cyradm.1.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/cyradm.1.html --- cyrus-imapd/doc/man/cyradm.1.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/cyradm.1.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,319 @@ + + + + + +COMMANDS FOR TCL SCRIPTS
+ + + + + + +

+
+

+ + + + + + + + + + + + + + + + +
+ +

OPTIONS
+-file script

+
+ +
+

Execute commands from script.

+
+
+ +

-user user

+

-u user

+
+ +

Log in to the server as user.

+

Short form of -user user.

+
+
+ + + + + + + +
+ +

-layers number
+
Specify the maximum allowable protection layer for the connection. 0 corresponds to no protec-
+tion, 1 to integrity protection, and more for n bits of privacy protection. Default is 10000, allowing
+virtually any protection mechanism.

+

-l number Short form of -layers prot.

+

-mech mechanism
+
Specify the SASL mechanism to use for authentication.

+

-m mechanism
+
Short form of -mech mechanism.

+

DESCRIPTION
+Cyradm is a simple Tcl-based administrative client for the Cyrus IMAP server. If invoked with a script, cyradm reads Tcl commands from the file script and evaluates them.

+

If invoked with host, cyradm runs in interactive mode, connecting to host on port port, authenticating, and then reading commands from the standard input and evaluating them. Port defaults to the standard IMAP port. Cyradm runs until the exit command is invoked or until it reaches end-of-file on its standard input. If the file .cyradmrc is in the home directory of the user, cyradm evaluates the file as a Tcl script just before reading the first command from standard input, after connecting and authenticating to server.

+

INTERACTIVE COMMANDS
+
The following commands are available only in interactive mode. In all commands, a mailbox or root of ``.'' speci- fies the same mailbox used previously in that connection.

+

createmailbox mailbox [partition]
+The createmailbox (or cm) command creates a new mailbox named mailbox. The optional partition argu-
+ment specifies the partition name on which to create the mailbox.

+

deletemailbox mailbox
+
The deletemailbox (or dm) command deletes the named mailbox.

+

Since administrators don't have implicit delete rights on all mailboxes, they may need to use setaclmailbox to
+give themselves delete rights before trying to delete a mailbox.

+

renamemailbox mailbox newmailbox [partition]
+The renamemailbox (or renm) command renames the named mailbox to newmailbox. The optional parti-
+tion
argument specifies the partition name on which to move the mailbox.

+

listmailbox [-subscribed] [pattern] [reference]
+The listmailbox (or lm) command returns a list of mailbox names matching the string pattern. If pattern is
+omitted, it defaults to ``*''. The optional reference argument specifies the reference name relative to which
+pattern is then interpreted.

+

Two wildcard characters are defined in pattern. The ``*'' wildcard matches zero or more characters. The
+``%'' wildcard is like the ``*'' wildcard except that it will not match the hierarchy separator, ``.''. For exam-
+ple, if ``listmailbox user.foo.%'' is specified, and the mailboxes ``user.foo.bar'' and ``user.foo.bar.old'' both
+exist, then ``user.foo.bar'' is listed, but ``user.foo.bar.old'' is not.

+

In some cases, where ``%'' is used as the last character of a pattern, non-mailbox names are listed in paren-
+theses. This indicates that the name is not actually a mailbox, yet there are sub-mailboxes underneath that
+name. For example, if ``listmailbox user.foo.%'' is specified, and the mailbox ``user.foo.bar.old'' exists, but
+``user.foo.bar'' does not exist, then ``(user.foo.bar)'' is listed.

+
+
+ + + + +

setaclmailbox mailbox identifier rights [identifier rights]...
+The setaclmailbox (or sam) command modifies the access control list of the mailbox mailbox. One or more
+identifier-rights pairs may be given after mailbox, each sets the ACL for identifier to rights.

+

Rights may be a set of access right letters:

+ + + + + + + + + + + + + + +
+ +

l

+

r

+
+ +

lookup (mailbox is visible to LIST/LSUB/UNSEEN commands)

+

read (SELECT the mailbox, perform CHECK, FETCH, PARTIAL, SEARCH, COPY
+from mailbox)

+
+ +

s

+

w

+

i

+

p

+

c

+

d

+

a

+
+ +

keep seen/unseen information across sessions (STORE \SEEN flag)

+

write (STORE flags other than \SEEN and \DELETED)

+

insert (perform APPEND, COPY into mailbox)

+

post (send mail to submission address for mailbox)

+

create (CREATE new sub-mailboxes in any implementation-defined hierarchy)

+

delete (STORE \DELETED flag, perform EXPUNGE)

+

administer (perform SETACL)

+
+

or one of the following words:

+ + + + + + + + + +
+ +

none

+

read

+

post

+

append

+

write

+

all

+
+ +

""

+

lrs

+

lrsp

+

lrsip

+

lrswipcd

+

lrswipcda

+
+
+

deleteaclmailbox mailbox identifier [identifier]...
+The deleteaclmailbox (or dam) command modifies the access control list of mailbox. One or more identi-
+fier
s may be specified, each identifier has its access control entry removed.

+

listaclmailbox mailbox
+
The listaclmailbox (or lam) command returns a string containing the access control list of the mailbox mail-
+box
.

+

setquota root quota...
+The setquota (or sq) command sets the limit on the quota root root to quota. The quota is one of the follow-
+ing:

+ + + + + + + + + + + + + + +
+ +

-

+

-

+
+ +

A single numeric value, limiting the use of storage to that value

+

A list of one or more resource-value pairs, limiting the use of each given resource to the given numeric
+value. The Cyrus server does not support resources other than storage.

+
+ +

-

+
+ +

none, specifying no limits whatsoever

+
+

listquota root
+
The listquota (or lq) command returns a string listing the quotas on the quota root root.

+

listquotaroot mailbox
+
The listquotaroot (or lqr or lqm) command returns a string listing the quota roots and quotas on the mailbox
+mailbox.

+

quit Same as the Tcl command exit. Close the connection and exit cyradm.

+

COMMANDS FOR TCL SCRIPTS

Cyradm adds one command to the standard Tcl command set.

+

cyradm connect connection [host] [port]
+The cyradm connect command opens a connection to host and creates a new Tcl command connection that
+may be used to invoke various operations on the connection. Host defaults to connection and port defaults to
+the standard IMAP port.

+

The cyradm connect command returns its connection argument.
+

+ + + + +

connection servername
+
Returns the name of the host that connection is connected to.

+

connection authenticate [switches]
+
Authenticates the connection. Switches are:

+ + + + + + + + + + + + + + + + + + + + +
+ +

-user user

+

-pwcommand script

+
+ +

Log in to the server as user.

+

Attempt a plaintext password login. The argument is a Tcl script which is executed to obtain the login information--the script must return a list with two elements, the user- name and the password. Before executing the script, the authenticate command will replace %-sequences as follows:

+
+ +

%%

+

%h

+

%u

+
+ +

replaced with a single %

+

replaced with the hostname of the server

+

replaced with the value of the -user switch, or the empty string if the -user
+
switch was not given

+
+ +

-layers number

+

-mech mechanism

+
+ +

Specify allowable protection mechanisms for the connection; see above.

+

Specify the SASL mechanism to use, if not plaintext login.

+
+

connection createmailbox mailbox [partition]
+Creates a mailbox on connection. Arguments are the same as for the interactive version of the command.

+

connection deletemailbox mailbox
+
Delete a mailbox on connection. Arguments are the same as for the interactive version of the command.

+

connection renamemailbox mailbox newmailbox [partition]
+Renames a mailbox on connection. Arguments are the same as for the interactive version of the command.

+

connection listmailbox [-subscribed] pattern [reference]
+Returns a list describing mailboxes on connection matching pattern. The optional reference argument speci-
+fies the reference name relative to which pattern is then interpreted.

+

The -subscribed switch limits the returned mailboxes to those to which the user has subscribed.

+

The returned value contains a list with one entry for each matching mailbox. Each entry is a list containing
+three elements, the name, a list of mailbox attributes, and the hierarchy delimiter. If there is no hierarchy
+delimiter, the third element is the empty string.

+

connection setaclmailbox mailbox identifier rights [...]
+Modifies an access control list on connection. Arguments are the same as for the interactive version of the
+command.

+

connection deleteaclmailbox mailbox identifier [...]
+Modifies an access control list on connection. Arguments are the same as for the interactive version of the
+command.

+

connection listaclmailbox mailbox
+
Returns a list containing the access control list of the mailbox mailbox on connection. The returned list con-
+tains alternating identifier right pairs.

+

connection setquota root [resource limit]...
+Sets the limit on the quota root root on connection. Zero or more resource limit pairs may be specified, spec-
+ifying the limit for each resource.

+

connection listquota root
+
Returns a list containing the quotas of the quota root root on connection. The returned list contains zero or
+more resource usage limit triplets.

+

connection listquotaroot mailbox
+
Returns a list containing the quota roots and quotas on the mailbox mailbox on connection. The returned list
+contains zero or more sublists; each sublist contains the name of a quota root followed by zero or more
+resource usage limit triplets.
+

+ + diff -ruN cyrus-imapd/doc/man/cyrus.conf.5.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/cyrus.conf.5.html --- cyrus-imapd/doc/man/cyrus.conf.5.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/cyrus.conf.5.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,258 @@ + + + + + +NAME
+DESCRIPTION
+SECTION DESCRIPTIONS
+EXAMPLE
+ACCESS CONTROL
+SEE ALSO
+ + + + + + +

NAME

cyrus.conf - Cyrus configuration file

+

DESCRIPTION

/etc/cyrus.conf is the configuration file for the Cyrus master process. It defines the startup procedures, services and events to be spawned by master.

+

The /etc/cyrus.conf file consists of a series of entries divided into sections of the form

+ + + + + + + + + + + + + + + + + + + + + + + +
+ +

section {

+
+ + +
+ + + +

name arguments
+...
+...
+...

+
+
+ +

}

+
+ + +
+

where section is the name of the section, name is the name of the entry and arguments is the whitespace-sepa- rated list of arguments for the entry.

+

Blank lines and lines beginning with ``#'' are ignored.

+

SECTION DESCRIPTIONS

The paragraphs below detail the three sections (START, SERVICES, EVENTS) that can be placed in the /etc/cyrus.conf file. The arguments that are available for each entry within the section are described, and each argument's default value is shown.

+

Arguments can appear in any order. Some arguments have no default value, these are listed with ``<no default>''. For string arguments, the value MUST be enclosed in double quotes.

+ + + + + + + + + + + + + + + + + +
+

START

+
+ +
+ + +

This section lists the processes to run before any SERVICES are spawned. This section is
+typically used to initialize databases and start long running daemons.

+
+

cmd=<no default>

+
+ +
+

The command (with options) to spawn as a child process. This string argument is required.

+ + + + + + + + + + + + + + + + + +
+

SERVICES

+
+ +
+ + +

This section is the heart of the /etc/cyrus.conf file. It lists the processes that should be
+spawned to handle client connections made on certain Internet/UNIX sockets.

+
+

cmd=<no default>

+
+ +
+

The command (with options) to spawn as a child process. This string argument is required.

+

listen=<no default>
+The UNIX or internet socket to listen on. This string field is required and takes one of the following forms:

+

path
+
[ host : ] port

+

where path is the explicit path to a UNIX socket, host is either the hostname or bracket-enclosed IP address
+of a network interface, and port is either a port number or service name (as listed in /etc/services).

+

proto=tcp
+The protocol used for this service (tcp, udp). This string argument is optional.

+

prefork=0
+The number of instances of this service to always have running (for faster initial response time). This integer
+value is optional.

+ + + + + + + + + + + + + + + + + +
+

EVENTS

+
+ +
+ + +

This section lists processes that should be run at specific intervals, similar to cron jobs.
+This section is typically used to perform scheduled cleanup/maintenance.

+
+

cmd=<no default>

+
+ +
+

The command (with options) to spawn as a child process. This string argument is required.

+

period=0
+The interval (in minutes) at which to run the command. This integer value is optional, but SHOULD be a pos-
+itive integer > 10.
+

+ + + + +

EXAMPLE

# example cyrus.conf

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

START {
+mboxlist

+
+ +
+

cmd="ctl_mboxlist -r"

+
+
+

deliver
+}

+

SERVICES {
+imap

+
+ +

cmd="ctl_deliver -r"

+

cmd="imapd" listen="imap" prefork=1

+
+
+

imaps
+lmtpunix
+lmtp
+}

+

EVENTS {
+checkpoint

+
+ +

cmd="imapd -s" listen="imaps" prefork=0
+cmd="lmtpd" listen="/var/imap/socket/lmtp"
+cmd="lmtpd" listen="localhost:lmtp"

+

cmd="ctl_mboxlist -c" period=30

+
+
+

delprune
+}

+
+ +

cmd="ctl_deliver -E 3" period=1440

+
+
+
+

ACCESS CONTROL

When TCP Wrappers is used to control access to Cyrus services, the name of the service entry should be used as the process name in the hosts_access(5) table. For instance, in the example above, "imap", "imaps", "lmtpunix" and "lmtp" would be used as the process names. This allows a single daemon such as imapd to be run in different modes or configurations (i.e., SSL and non-SSL enabled) yet still have separate access control rules.

+

SEE ALSO

master(8), imapd(8), pop3d(8), lmtpd(8), timsieved(8), idled(8), hosts_access(5)
+

+ + diff -ruN cyrus-imapd/doc/man/deliver.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/deliver.8.html --- cyrus-imapd/doc/man/deliver.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/deliver.8.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,79 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+NOTES
+FILES
+/etc/imapd.conf
+SEE ALSO
+lmtpd(8)
+ + + + + + +

NAME

deliver - deliver mail to an IMAP mailbox

+

SYNOPSIS

+ + + + + +
+

deliver [ -C config-file ] [ -d ] [ -r address ]
+[ -f address ] [ -m mailbox ] [ -a auth-id ]
+[ -q ] [ userid ]...
+deliver [ -C config-file ] -l

+
+
+
+

DESCRIPTION

Deliver reads a message from the standard input and delivers it to one or more IMAP mailboxes.

+

Deliver reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

+ + + + + + + + + + + +
+

-C config-file

+

-d

+

-r address

+

-f address

+

-m mailbox

+
+ +

Read configuration options from config-file.

+

Ignored for compatability with /bin/mail.

+

Insert a Return-Path: header containing

+

Insert a Return-Path: header containing

+

Deliver to mailbox. If any userids are specified, attempts to deliver to user.userid.mailbox for each userid. If the ACL on any such mailbox does not grant the sender the "p" right or if -m is not specified, then delivers to the INBOX for the userid, regardless of the ACL on the INBOX.

+

If no userids are specified, attempts to deliver to mailbox. If the ACL on mailbox does not grant the sender the "p" right, the delivery fails.

+
+

-a auth-id

+

-q

+

-l

+
+ +

Specify the authorization id of the sender. Defaults to "anonymous".

+

Deliver message even when receiving mailbox is over quota.

+

Accept messages using the LMTP protocol.

+
+
+

NOTES

Depending on the setting of reject8bit in imapd.conf(5), deliver either rejects messages with 8-bit-set characters in the headers or changes these characters to `X'. This is because such characters can't be interpreted since the character set is not known, although some communities not well-served by US-ASCII assume that those charac- ters can be used to represent characters not present in US-ASCII.

+

A method for encoding 8-bit-set characters is provided by RFC 2047.

+

FILES

/etc/imapd.conf

SEE ALSO

lmtpd(8)

+ diff -ruN cyrus-imapd/doc/man/fud.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/fud.8.html --- cyrus-imapd/doc/man/fud.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/fud.8.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,29 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+BUGS
+ + + + + + +

NAME

fud - provide information about user mailboxes

+

SYNOPSIS

fud [ -C config-file ]

+

DESCRIPTION

Fud is a long lived datagram daemon started from inetd that provides information about when a user last read their mail, when mail last arrived in a user's mailbox, and how many messages are recent for that user.

+

Fud reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

-C config-file Read configuration options from config-file.

+

FILES

/etc/imapd.conf

BUGS

Though not really a bug, FUD will silently ignore any requests that it does not consider valid.

+

FUD is an experimental interface meant to provide information to build a finger-like service around. Eventually it should be superceded by LDAP or ACAP (using the mailbox dataset).
+

+ + diff -ruN cyrus-imapd/doc/man/idled.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/idled.8.html --- cyrus-imapd/doc/man/idled.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/idled.8.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,28 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

idled - provide near real-time updates for IMAP IDLE

+

SYNOPSIS

idled [ -C config-file ]

+

DESCRIPTION

Idled is a long lived datagram daemon which receives notifications of mailbox changes and signals the appropriate imapd to report the changes to the client. Idled is usually started from master.

+

Idled reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. The idlesocket option is used to specify the Unix domain socket to listen on for notifications.

+

OPTIONS

-C config-file Read configuration options from config-file.

+

FILES

/etc/imapd.conf

SEE ALSO

imapd.conf(5), master(8)
+

+ + diff -ruN cyrus-imapd/doc/man/imapd.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imapd.8.html --- cyrus-imapd/doc/man/imapd.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imapd.8.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,65 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

imapd - IMAP server process

+

SYNOPSIS

imapd [ -C config-file ] [ -s ] [ -p ssf ]

+

DESCRIPTION

Imapd is an IMAP4rev1 server. It accepts commands on its standard input and responds on its standard output. It MUST be invoked by master(8) with those descriptors attached to a remote client connection.

+

Imapd reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

If the file msg/shutdown is created under the directory specified in the configdirectory configuration option, then imapd will shut down the connection, sending the first line contained in the file to the client as the reason. New connections are denied.

+

If the file msg/motd is created under the directory specified in the configdirectory configuration option, then imapd will send the first line contained in the file to clients upon connect as an ALERT message which IMAP-compliant clients are required to display. This option serves to annoy users mostly. Unfortunately clients tend to connect far more frequently than is apparent, causing each connection to generate a seperate server ALERT for each con- nection. Many clients do not display these properly, if they do anything with them at all.

+

If the directory log/user exists under the directory specified in the configdirectory configuration option, then imapd will create protocol telemetry logs for sessions authenticating as user. The telemetry logs will be stored in the log/user directory with a filename of the imapd process-id.

+

OPTIONS

+ + + + + + + + + + + + + + + + +
+

-C config-file

+

-s

+
+ +

Read configuration options from config-file.

+

Serve IMAP over SSL (imaps). All data to and from imapd is encrypted using the Secure Sockets Layer.

+
+

-p ssf

+
+ +

Tell imapd that an external layer exists. An SSF (security strength factor) of 1 means an
+integrity protection layer exists. Any higher SSF implies some form of privacy protection.

+
+ + +
+
+

FILES

/etc/imapd.conf

SEE ALSO

imapd.conf(5), master(8)
+

+ + diff -ruN cyrus-imapd/doc/man/imapd.conf.5.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imapd.conf.5.html --- cyrus-imapd/doc/man/imapd.conf.5.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imapd.conf.5.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,221 @@ + + + + + +NAME
+DESCRIPTION
+FIELD DESCRIPTIONS
+sasl_option
+SEE ALSO
+ + + + + + +

NAME

imapd.conf - IMAP configuration file

+

DESCRIPTION

/etc/imapd.conf is the configuration file for the Cyrus IMAP server. It defines local parameters for IMAP.

+

Each line of the /etc/imapd.conf file has the form

+

option: value

+

where option is the name of the configuration option being set and value is the value that the configuration option is being set to.

+

Blank lines and lines beginning with ``#'' are ignored.

+

For boolean options, the values ``yes'', ``on'', ``t'', and ``1'' turn the option on, the values ``no'', ``off'', ``f'', and ``0'' turn the option off.

+

FIELD DESCRIPTIONS

The sections below detail options that can be placed in the /etc/imapd.conf file, and show each option's default value. Some options have no default value, these are listed with ``<no default>''. Some options default to the empty string, these are listed with ``<none>''.

+

configdirectory: <no default>
+The pathname of the IMAP configuration directory. This field is required.

+

defaultpartition: default
+The partition name used by default for new mailboxes.

+

partition-name: <no default>
+The pathname of the partition name. At least one field, for the partition named in the defaultpartition option,
+is required. For example, if the value of the defaultpartion option is default, then the partition-default field
+is required.

+

unixhierarchysep: no
+Use the UNIX separator character '/' for delimiting levels of mailbox hierarchy. The default is to use the net-
+news separator character '.'.

+

altnamespace: no
+Use the alternate IMAP namespace, where personal folders reside at the same level in the hierarchy as
+INBOX.

+

This option ONLY applies where interaction takes place with the client/user. Currently this is limited to the
+IMAP protocol (imapd) and Sieve scripts (lmtpd). This option does NOT apply to admin tools such as
+cyradm (admins ONLY), reconstruct, quota, etc., NOR does it affect LMTP delivery of messages directly to
+mailboxes via plus-addressing.

+

userprefix: Other Users
+If using the alternate IMAP namespace, the prefix for the other users namespace. The hierarchy delimiter
+will be automatically appended.

+

sharedprefix: Shared Folders
+If using the alternate IMAP namespace, the prefix for the shared namespace. The hierarchy delimiter will
+be automatically appended.

+

umask: 077
+The umask value used by various Cyrus IMAP programs.

+

servername: <result returned by gethostname(2)>
+This is the hostname visible in the greeting messages of the POP, IMAP and LMTP daemons. If it is unset,
+then the result returned from gethostname(2) is used.

+

allowanonymouslogin: no
+Permit logins by the user "anonymous" using any password. Also allows use of the SASL ANONYMOUS
+mechanism.

+

allowplaintext: yes
+Allow the use of the SASL PLAIN mechanism.

+

quotawarn: 90
+The percent of quota utilization over which the server generates warnings.
+

+ + + + + + + + + + + +
+

timeout: 30
+The length of the IMAP server's inactivity autologout timer, in minutes.
+default.

+

imapidlepoll: 60

+
+ +
+

The minimum value is 30, the

+
+

The interval (in seconds) for polling the mailbox for changes while running the IDLE command. This option
+is used when idled can not be contacted or when polling is used exclusively. The minimum value is 1. A
+value of 0 will disable polling (and disable IDLE if polling is the only method available).

+

imapidresponse: yes
+If enabled, the server responds to an ID command with a parameter list containing: version, vendor, support-
+url, os, os-version, command, arguments, environment. Otherwise the server returns NIL.

+

poptimeout: 10
+Set the length of the POP server's inactivity autologout timer, in minutes. The minimum value is 10, the
+default.

+

popminpoll: 0
+Set the minimum amount of time the server forces users to wait between successive POP logins, in minutes.
+The default is 0.

+

popexpiretime: 0
+The number of days advertised as being the minimum a message may be left on the POP server before it is
+deleted (via the CAPA command, defined in the POP3 Extension Mechanism, which some clients may sup-
+port). "NEVER", the default, may be specified with a negative number. The Cyrus POP3 server never
+deletes mail, no matter what the value of this parameter is. However, if a site implements a less liberal pol-
+icy, it needs to change this parameter accordingly.

+

admins: <none>
+The list of userids with administrative rights. Separate each userid with a space. Sites using Kerberos
+authentication may use separate "admin" instances.

+

Note that accounts used by users should not be administrators. Administrative accounts should not receive mail. That is, if user "jbRo" is a user reading mail, he should not also be in the admins line. Some problems may occur otherwise, most notably the ability of administrators to create top-level mailboxes visible to users, but not writable by users.

+

proxyservers: <none>
+A list of users and groups that are allowed to proxy for other users, seperated by spaces. Any user listed in
+this will be allowed to login for any other user: use with caution.

+

defaultacl: anyone lrs
+The Access Control List (ACL) placed on a newly-created (non-user) mailbox that does not have a parent
+mailbox.

+

newsspool: <no default>
+The pathname of the news spool directory. Only used if the partition-news configuration option is set.

+

newsprefix: <none>
+Prefix to be prepended to newsgroup names to make the corresponding IMAP mailbox names.

+

autocreatequota: 0
+If nonzero, normal users may create their own IMAP accounts by creating the mailbox INBOX. The user's
+quota is set to the value if it is positive, otherwise the user has unlimited quota.

+

logtimestamps: no
+Include notations in the protocol telemetry logs indicating the number of seconds since the last command or
+response.

+

plaintextloginpause: 0
+Number of seconds to pause after a successful plaintext login. For systems that support strong authentica-
+tion, this permits users to perceive a cost of using plaintext passwords. (This does not effect the use of
+PLAIN in SASL authentications.)

+

srvtab: /etc/srvtab
+The pathname of srvtab file containing the server's private key. This option is passed to the SASL library
+and overrides its default setting.

+

loginrealms: <none>
+The list of remote realms whose users may log in using cross-realm authentications. Seperate each realm
+name by a space. (A cross-realm identity is considered any identity returned by SASL with an "@" in it.)
+

+ + + + +

loginuseacl: no
+If enabled, any authentication identity which has a rights on a user's INBOX may log in as that user.

+

singleinstancestore: yes
+If enabled, deliver running in LMTP mode attempts to only write one copy of a message per partition and
+create hard links, resulting in a potentially large disk savings.

+

reject8bit: no
+If enabled, deliver rejects messages with 8-bit characters in the headers. Otherwise, 8-bit characters are
+changed to `X'. (A proper soultion to non-ASCII characters in headers is offered by RFC 2047 and its prede-
+cessors.)

+

postuser: <none>

+ + + + + + + + + + + +
+

Userid used to deliver messages to shared folders. For example,
+"bb+shared.blah" would be delivered to the "shared.blah" folder. By
+"+shared.blah" would be used.

+

netscapeurl: http://andrew2.andrew.cmu.edu/cyrus/imapd/netscape-admin.html

+
+ +

if set to
+default,

+
+ +

"bb", email sent an email address

+
+ +

to
+of

+
+

If enabled at compile time, this specifies a URL to reply when Netscape asks the server where the mail
+administration HTTP server is. The default is a site at CMU with a hopefully informative message; adminis-
+trators should set this to a local resource with some information of greater use.

+

sieveusehomedir: false
+If enabled, deliver will look for Sieve scripts in user's home directories: ~user/.sieve.

+

sievedir: /usr/sieve
+If sieveusehomedir is false, this directory is searched for Sieve scripts.

+

sendmail: /usr/lib/sendmail
+The pathname of the sendmail executable. Sieve uses sendmail for sending rejections, redirects and vaca-
+tion responses.

+

postmaster: postmaster
+Username that is used as the 'From' address in rejection MDNs produced by sieve.

+

hashimapspool: false
+If enabled, the partitions will also be hashed, in addition to the hashing done on configuration directories. This
+is recommended if one partition has a very bushy mailbox tree.

+

sieve_maxscriptsize: 32
+Maximum size (in kilobytes) any sieve script can be, enforced at submission by timsieved(8).

+

sieve_maxscripts: 5
+Maximum number of sieve scripts any user may have, enforced at submission by timsieved(8).

+

sasl_maximum_layer: 256
+Maximum SSF (security strength factor) that the server will allow a client to negotiate.

+

sasl_minimum_layer: 0
+The minimum SSF that the server will allow a client to negotiate. A value of 1 requires integrity protection;
+any higher value requires some amount of encryption.

+

sasl_pwcheck_method: PAM
+The mechanism used by the server to verify plaintext passwords. Possible values also include "sasldb",
+"kerberos_v4", "passwd", and "shadow".

+

sasl_auto_transition: no
+If enabled, the SASL library will automatically create authentication secrets when given a plaintext pass-
+word. See the SASL documentation.

+

sasl_option

Any other SASL option can be set by preceeding it with "sasl_". This file overrides the SASL configuration
+file.

+

lmtpsocket: /var/imap/socket/lmtp
+Unix domain socket that lmtpd listens on.

+

idlesocket: /var/imap/socket/idle
+Unix domain socket that idled listens on.

+

notifysocket: /var/imap/socket/notify
+Unix domain socket that the new mail notification daemon listens on.
+

+ + + + +

SEE ALSO

imapd(8), pop3d(8), lmtpd(8), timsieved(8), idled(8), deliver(8), master(8)
+

+ + diff -ruN cyrus-imapd/doc/man/imclient.3.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imclient.3.html --- cyrus-imapd/doc/man/imclient.3.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imclient.3.html Sun Jul 8 17:04:45 2001 @@ -0,0 +1,338 @@ + + + + + +NAME
+SYNOPSIS
+#include
+DESCRIPTION
+imclient_connect()
+imclient_servername()
+imclient_addcallback()
+imclient_processoneevent()
+imclient_authenticate()
+EXAMPLES
+BUGS
+SEE ALSO
+select(2)
+KEYWORDS
+COPYRIGHT
+ + + + + + +

NAME

imclient library - authenticating callback interface to IMAP/IMSP servers

+

SYNOPSIS

#include

+ + + + + +
+

int imclient_connect(struct imclient **imclient, const char *host, const char *port);

+

void imclient_close (struct imclient *imclient);

+

void imclient_setflags(struct imclient *imclient, intflags);

+

void imclient_clearflags (struct imclient *imclient, intflags);

+

char* imclient_servername (struct imclient *imclient);

+
+
+

void imclient_addcallback (struct imclient * imclient ,...);

+ + + + + + +
+

void imclient_send (struct imclient *imclient, void (*finishproc)(), void *finishrock, const char *fmt, ...);

+

void imclient_getselectinfo (struct imclient *imclient, int *fd, int * wanttowrite);

+

void imclient_processoneevent (struct imclient *imclient);

+

int imclient_authenticate (struct imclient *imclient, struct sasl_client **availmech, const char *service, const
+char *
user, int protallowed);

+
+
+

DESCRIPTION

+ + + + + +
+

The imclient library functions are distributed with Cyrus IMAP and IMSP. These functions are used for building
+IMAP/IMSP client software. These functions handle Kerberos authentication and can set callbacks based on the
+keyword in untagged replies or based on the command tag at the end of command replies.

+

Users must link with the -lcyrus switch, and must supply a function called fatal to be called in case of any error
+within libcyrus.a.

+

All of the imclient functions begin with the prefix imclient and takes an argument of type struct imclient * as the
+first argument which is initialized by imclient_connect and freed by imclient_close.

+

See below for a description of each function.

+
+
+

imclient_connect()

+ + + + + +
+ +

Connects the client server to the host. If successful, it returns 0 and sets the imclient argument to a pointer to
+an imclient struct. The imclient struct represents the current connection, flags, and callbacks. On failure,
+the current errno is returned if a system call failed, -1 is returned if the host name was not found, and -2 is
+returned if the service name was not found.

+
+

imclient_close()

+ + + + + + + +
+ +

Closes and frees the imclient connection.

+

imclient_setflags()
+
Sets the flags specified by the flags argument on the imclient connection. Currently the only flag allowed is
+IMCLIENT_CONN_NONSYNCLITERAL (this flag indicates that the server supports non-synchronizing
+literals described by the LITERAL+ extension).

+
+
+

imclient_clearflags()
+
Clears the flags specified by the flags argument on the imclient connection.

+

imclient_servername()

Returns a char * pointer to the name of the server connected to by imclient.

+

imclient_addcallback()

+ + + + + +
+ +

Adds an untagged data callback to the imclient connection. The function imclient_addcallback takes call-
+backs of the type imclient_proc_t which is defined to be:
+typedef void imclient_proc_t (struct imclient *imclient, void *rock, struct imclient_reply
+*reply);

+

and struct imclient_reply * is defined to be:

+

struct imclient_reply {
+char *keyword;
+long msgno;
+char *text;
+};

+

After the first argument imclient, there can be zero or more instances of the set of keyword, flags, proc, and

+
+ + + + + + + + + + + +
+ +

rock, each adding or changing a single callback. Each instance adds or changes the callback for keyword.
+
The argument, flags, specifies information about the parsing of the untagged data. proc and rock specify the
+callback function and rock to invoke when the untagged data is received. proc may be a null pointer, in
+which case no function is invoked. The callback function may not call the functions imclient_close(),
+imclient_send(), imclient_eof(), imclient_processoneevent(),
or imclient_authenticate() on the connec-
+tion. The callback function may over write the text of untagged data.

+
+
+

imclient_send()

+ + + + + + + +
+ +

Sends a new command to the imclient connection. finishproc and finnishrock are the function and rock
+called when the command completes. functionproc may be a null pointer, in which case no callback is
+made. The call back function may not call the functions imclient_close(), imclient_send(), imclient_eof(),
+imclient_processoneevent(),
or imclient_authenticate() on the connection. The argument, fmt , is a print
+like specification of the command. It must not include the tag as the tag is automatically added by
+imclient_send(). The defined %-sequences are:

+

%% for %

+

%a for an IMAP atom

+

%s for an astring (which will be quoted or literalized as needed)

+

%d for a decimal

+

%u for an unsigned decimal

+

%v for #astring (argument is a null-terminated array of char * which are written as
+space separated astrings)

+
+
+

imclient_getselectinfo()
+
Gets the information for calling select(2). fd is filled in with the file descriptor to select(2) for read. want-
+towrite
is filled in with a nonzero value if select should be used for write as well.

+

imclient_processoneevent()

Processes one input or output event on the imclient connection.

+

imclient_authenticate()

+ + + + + +
+ +

Authenticates the imclient connection using one of the mechanisms in availmech. The argument, user, if not
+NULL, specifies the user to authenticate as. If the user is NULL, the current user is used. The argument
+protallowed is a bitmask of permissible protection mechanisms.

+

On success, 0 is returned. On failure (i.e., "BAD" keyboard, or no authentication mechanisms worked), 1 is
+returned. On extreme failure (premature "OK"), 2 is returned.

+
+

EXAMPLES

+ + + + + +
+

The following code is a possible skeletion of imclient that relies on Kerberos to do authentication. This code pre-
+forms an IMAP CAPABILITY request and prints out the result.

+

struct sasl_client;
+#include <cyrus/xmalloc.h> /* example uses xstrdup */
+#include <cyrus/sasl.h>
+#include <cyrus/imclient.h>
+#include <stdio.h>

+

extern struct sasl_client krb_sasl_client;

+

struct sasl_client *login_sasl_client[] = {

+
+
+

&krb_sasl_client,
+NULL

+ + + + + + +
+

};
+struct imclient *imclient;
+char server[] = "cyrus.andrew.cmu.edu" ;
+char port[] = "imap";

+

void fatal(char* message, int rc) {

+
+
+

fprintf(stderr, "fatal error: %s\n", message);
+exit(rc);
+}

+

static void callback_capability(struct imclient *imclient,
+void *rock,
+

+ + + + +

struct imclient_reply *reply) {

+ + + + + + + + +
+

}

+
+ +

if (reply->text != NULL) {
+*((char**)rock) = xstrdup( reply->text );
+}

+
+
+ + + + + + +
+

static void end_command (struct imclient *connection, void*
+rock, struct imclient_reply *inmsg) {
+(*(int*)rock)--;
+}

+

main() {

+
+
+ + + + + + + + + + + + + + +
+ + +

char* capability_string;
+int nc;

+

if (imclient_connect(&imclient, server, port)) {
+fprintf(stderr,
+"error: Couldn't connect to %s %s\n",
+server, port);
+exit(1);
+}

+

if (imclient_authenticate(imclient, login_sasl_client, "imap"
+/* service */,
+NULL /* user */, SASL_PROT_ANY)) {
+exit(1);
+}

+

imclient_addcallback(imclient, "CAPABILITY",
+CALLBACK_NOLITERAL,
+callback_capability,
+&capability_string,
+NULL);

+

nc = 1;

+

imclient_send(imclient, end_command,
+(void*) &nc, "CAPABILITY");

+

while(nc > 0) {
+imclient_processoneevent(imclient);
+}

+

if (strstr("LITERAL+", capability_string)) {
+imclient_setflags(imclient, IMCLIENT_CONN_NONSYNCLITERAL);
+}

+

imclient_send(imclient, NULL, NULL, "LOGOUT");
+imclient_close(imclient);

+

printf("capability text is: %s\n", capability_string);

+

free(capability_string);

+
+
+

}

+
+ + +
+

BUGS

No known bugs.

+

SEE ALSO

cyradm, imapd, imspd, RFC2033 (IMAP LITERAL+ extension), RFC2060 (IMAP4rev1 specification), and
+

+

select(2)

+ + + +

KEYWORDS

IMAP, ACAP, IMSP, Kerberos, Authentication

+

COPYRIGHT

Copyright 1997, Carnegie Mellon University. All Rights Reserved.

+

This software is made available for academic and research purposes only. No commercial license is hereby
+granted. Copying and other reproduction is authorized only for research, education, and other non-commercial
+purposes. No warranties, either expressed or implied, are made regarding the operation, use, or results of the
+software. Such a release does not permit use of the code for commercial purposes or benefits by anyone without specific, additional permission by the owner of the code.
+

+ + diff -ruN cyrus-imapd/doc/man/imtest.1.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imtest.1.html --- cyrus-imapd/doc/man/imtest.1.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/imtest.1.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,92 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+SEE ALSO
+imapd(8)
+ + + + + + +

NAME

imtest - interactive IMAP test program

+

SYNOPSIS

imtest [ -t keyfile ] [ -p port ] [ -m mechanism ]
+[ -u user ] [ -a user ] [ -k num ] [ -l num ]
+[ -r realm ] [ -f file ] [ -v ] [ -z ] hostname

+

DESCRIPTION

imtest is a utility that allows you to authenticate to a IMAP or IMSP server and interactively issue commands to it. Once authenticated you may issue any IMAP or IMSP command by simply typing it in. It is capable of multiple SASL authentication mechanisms and handles encryption layers transparently. This utility is often used for testing the operation of a imsp or imap server. Also those developing IMAP clients find it useful.

+

OPTIONS

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

-t keyfile

+
+ +

Enable TLS. keyfile contains the TLS public and private keys. Specify "" to negotiate a TLS encryption layer but not use TLS authentication.

+
+

-p port

+

-m mechanism

+
+ +

Port to connect to. If left off this defaults to imap as defined in /etc/services.

+

Force imtest to use mechanism for authentication. If not specified the strongest authentica- tion mechanism supported by the server is chosen. Specify login to use the LOGIN com- mand instead of AUTHENTICATE.

+
+

-u user

+

-a user

+

-k num

+

-l num

+
+ +

Username to use for authentication; defaults to the current user.

+

Authname to use for authentication; defaults to the current user.

+

Minimum protection layer required.

+

Maximum protection layer to use (0=none; 1=integrity; etc). For example if you are using the KERBEROS_V4 authentication mechanism specifying 0 will force imtest to not use any layer and specifying 1 will force it to use the integrity layer. By default the maximum sup- ported protection layer will be used.

+
+

-r realm

+
+ +

Specify the realm to use. Certain authentication mechanisms (e.g. DIGEST-MD5) may
+require one to specify the realm.

+
+

-f file

+

-v

+

-z

+
+ +

Pipe file into connection after authentication.

+

Verbose. Print out more information than usual.

+

Timing test.

+
+
+

SEE ALSO

imapd(8)

+ diff -ruN cyrus-imapd/doc/man/installsieve.1.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/installsieve.1.html --- cyrus-imapd/doc/man/installsieve.1.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/installsieve.1.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,31 @@ + + + + + +NAME
+SYNOPSIS
+installsieve
+DESCRIPTION
+OPTIONS
+ + + + + + +

NAME

installsieve - user utility for managing sieve scripts

+

SYNOPSIS

installsieve

DESCRIPTION

installsieve is a utility that allows users to manage their sieve scripts kept on the server.

+

OPTIONS

-v <name> View script with the given name. The script if retrieved sucessfully is output to standard output.

+

-l List all of the scripts currently on the server. If one of the scripts is active a arrow is printed indicating that it is the active script.

+

-p <port> Port to connect to. If left off this defaults to "sieve" as defined in /etc/services.

+

-i <file> Install a file onto the server. If a script with the same name already exists on the server it is overwritten. Upon sucessfully putting the script on the server the script is set active. If <file> has the extension .script it is chopped when put on the server since sieve names may not contain a '.'.

+

-a <name> Set <name> as the active script. The list of available names can be obtained from the '-l' option..

+

-d <name> Delete the sieve script on the server with <name>.

+

-m <mechanism> Force installsieve to use <mechanism> for authentication. If not specified the strongest authen- tication mechanism is chosen.

+

-g <name> Get the sieve script with <name> and save it to disk with a ".script" extension. If a file with that name already exists it is overwritten.

+

-u <user> Userid/Authname to use for authentication; by default, the current user.
+

+ + diff -ruN cyrus-imapd/doc/man/ipurge.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/ipurge.8.html --- cyrus-imapd/doc/man/ipurge.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/ipurge.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,72 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+ + + + + + +

NAME

ipurge - delete mail from IMAP mailbox or partition based on age or size

+

SYNOPSIS

ipurge [ -C config-file ] [ -x ]
+[ -d days | -b bytes | -k Kbytes | -m Mbytes ]
+[ mailbox-pattern... ]

+

DESCRIPTION

Ipurge deletes messages from the mailbox(es) specified by mailbox-pattern that are older or larger than specified by the -d, -b, -k or -m options. If no mailbox-pattern is given, ipurge works on all mailboxes. If the -x option is given, the message age and size MUST match exactly those specified by -d, -b, -k or -m. The are no default val- ues, and at least one of -d, -b, -k or -m MUST be specified.

+

Ipurge reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

+ + + + + + + + + + + + + + + + + + + +
+

-C config-file

+

-d days

+

-b bytes

+

-k Kbytes

+
+ +

Read configuration options from config-file.

+

Age of message in days.

+

Size of message in bytes.

+

Size of message in Kbytes (2^10 bytes).

+
+
+

-m Mbytes

+
+ +

Size of message in Mbytes (2^20 bytes).

+
+
+

-x

+
+ +

Perform an exact match on age or size (instead of older or larger).

+
+
+
+

FILES

/etc/imapd.conf

+ diff -ruN cyrus-imapd/doc/man/krb.equiv.5.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/krb.equiv.5.html --- cyrus-imapd/doc/man/krb.equiv.5.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/krb.equiv.5.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,35 @@ + + + + + +NAME
+DESCRIPTION
+SAMPLE FILE
+ + + + + + +

NAME

/etc/krb.equiv - Kerberos equivalences

+

DESCRIPTION

krb.equiv contains zero or more lines, each of which describes a mapping of a kerberos principal (userid@host) to a local user (userid or alias). Each line of the file consists of two fields, separated by at least one whitespace char- acter; other blanks are ignored. The first field is the kerberos principal name to remap, and the second is the name of the corresponding local user.

+

SAMPLE FILE

+ + + + + +
+

tyq4@ANDY.CMU.EDU tyq4
+tyq4@DEANNA.ORG tyq4
+ty347@ECE.CMU.EDU tyq4
+jj12@ANDY.CMU.EDU tick
+tick@DEANNA.ORG tick
+jy9o@ANDY.CMU.EDU jyager
+jyager@CS.CMU.EDU jyager

+
+
+ + diff -ruN cyrus-imapd/doc/man/lmtpd.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/lmtpd.8.html --- cyrus-imapd/doc/man/lmtpd.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/lmtpd.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,51 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

lmtpd - LMTP server process

+

SYNOPSIS

lmtpd [ -C config-file ] [ -a ]

+

DESCRIPTION

Lmtpd is an LMTP server used to deliver mail to the IMAP mailstore. It accepts commands on its standard input and responds on its standard output. It MUST be invoked by master(8) with those descriptors attached to a remote client connection.

+

Lmtpd reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

-C config-file Read configuration options from config-file.

+ + + + + + + + + + + + +
+

-a

+
+ +

Preauthorize connections initiated on an internet socket, instead of requiring LMTP AUTH.
+This should only be used for connections coming from trusted hosts.

+
+ + +
+
+

FILES

/etc/imapd.conf

SEE ALSO

imapd.conf(5), master(8)
+

+ + diff -ruN cyrus-imapd/doc/man/master.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/master.8.html --- cyrus-imapd/doc/man/master.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/master.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,38 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+CONFIGURATION
+NOTES
+FILES
+/etc/cyrus.conf, /etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

master - master Cyrus process

+

SYNOPSIS

master [ -l listen queue ] [ -D ]

+

DESCRIPTION

Master is the process that controls all of the Cyrus processes. This process is responsible for creating all imapd, pop3d, lmtpd and sieved child processes. This process also initializes the Berkeley DB code and performs sched- uled cleanup/maintenance.

+

If this process dies, then no new sessions will be started.

+

It kills itself and all child processes when it receives a SIGTERM.

+

OPTIONS

-l listen queue backlog
+
Increase the listen queue backlog. By default, the listen queue is set to 32. On systems
+with a high connection rate, it may be desirable to increase this value. refer to listen(2) for
+details.

+

-D Don't close stdin/stdout/stderr. Primiarly useful for debugging.

+

CONFIGURATION

Upon execution, master reads its configuration information out of the cyrus.conf(5) file.

+

Master rereads its configuration file when it receives a hangup signal, SIGHUP. Services and events may be added, deleted or modified when the configuration file is reread. Any active services removed from the configura- tion file will be allowed to run until completion.

+

NOTES

The environment variable CYRUS_VERBOSE can be set to log additional debugging information. Setting the value to 1 results in base level logging. Setting it higher results in more log messages being generated.

+

FILES

/etc/cyrus.conf, /etc/imapd.conf

SEE ALSO

cyrus.conf(5), imapd.conf(5), imapd(8), pop3d(8), lmtpd(8), timsieved(8), idled(8)
+

+ + diff -ruN cyrus-imapd/doc/man/mbpath.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/mbpath.8.html --- cyrus-imapd/doc/man/mbpath.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/mbpath.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,27 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+ + + + + + +

NAME

mbpath - translate mailbox names to filesystem paths

+

SYNOPSIS

mbpath [ -C config-file ] [ -q ] [ mailbox-names... ]

+

DESCRIPTION

Given a mailbox name or a space separated list of mailbox names, mbpath outputs the filesystem path to the mail- box.

+

Mbpath reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

-C config-file Read configuration options from config-file.

+

-q suppress any error output.

+

-s if any error occurs, stop processing the list of mailboxes and exit.

+

FILES

/etc/imapd.conf

+ diff -ruN cyrus-imapd/doc/man/pop3d.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/pop3d.8.html --- cyrus-imapd/doc/man/pop3d.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/pop3d.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,55 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

pop3d - POP3 server process

+

SYNOPSIS

pop3d [ -C config-file ] [ -s ] [ -k ]

+

DESCRIPTION

Pop3d is a POP3 server. It accepts commands on its standard input and responds on its standard output. It MUST invoked by master(8) with those descriptors attached to a remote client connection.

+

Pop3d reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

If the directory log/user exists under the directory specified in the configdirectory configuration option, then pop3d will create protocol telemetry logs for sessions authenticating as user. The telemetry logs will be stored in the log/user directory with a filename of the pop3d process-id.

+

OPTIONS

+ + + + + + + + + + + +
+

-C config-file

+

-s

+
+ +

Read configuration options from config-file.

+

Serve POP3 over SSL (pop3s). All data to and from pop3d is encrypted using the Secure
+Sockets Layer.

+
+

-k

+
+ +

Serve MIT's KPOP (Kerberized POP) protocol instead.

+
+
+

FILES

/etc/imapd.conf

SEE ALSO

imapd.conf(5), master(8)
+

+ + diff -ruN cyrus-imapd/doc/man/quota.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/quota.8.html --- cyrus-imapd/doc/man/quota.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/quota.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,27 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+ + + + + + +

NAME

quota - report and optionally fix quota usage

+

SYNOPSIS

quota [ -C config-file ] [ -f ] [ mailbox-prefix... ]

+

DESCRIPTION

Quota generates a report listing quota roots, giving their limits and usage. If the -f option is given, quota first fixes any inconsistencies in the quota subsystem, such as mailboxes with the wrong quota root or quota roots with the wrong quota usage reported. If any optional mailbox-prefix arguments are given, the quota listing (and inconsis- tency fixing) is limited to quota roots with names that start with one of the given prefixes.

+

Running quota with both the -f option and mailbox-prefix arguments is not recommended.

+

Quota reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

-C config-file Read configuration options from config-file.

+

-f Fix any inconsistencies in the quota subsystem before generating a report.

+

FILES

/etc/imapd.conf

+ diff -ruN cyrus-imapd/doc/man/reconstruct.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/reconstruct.8.html --- cyrus-imapd/doc/man/reconstruct.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/reconstruct.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,72 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+ + + + + + +

NAME

reconstruct - reconstruct mailboxes

+

SYNOPSIS

reconstruct [ -C config-file ] [ -r ] [ -f ] mailbox...
+reconstruct [ -C config-file ] -m

+

DESCRIPTION

Reconstruct rebuilds one or more IMAP mailboxes. When invoked with the -m switch, it rebuilds the master mailboxes file. It can be used to recover from almost any sort of data corruption.

+

If Reconstruct can find existing header and index files, it attempts to preserve any data in them that is not derivable from the message files themselves. The state reconstruct attempts to preserve includes the flag names, flag state, and internaldate. Reconstruct derives all other information from the message files.

+

Reconstruct reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. Any mailbox directory underneath the path specified in the partition-news configuration option is assumed to be in news format.

+

Reconstruct does not adjust the quota usage recorded in any quota root files. After running reconstruct, it is advis- able to run quota(8) with the -f switch in order to fix the quota root files.

+

OPTIONS

+ + + + + + + + + + + + + + + + + + + + + +
+

-C config-file

+

-r

+
+ +

Read configuration options from config-file.

+

Recursively reconstruct all sub-mailboxes of the mailboxes or mailbox prefixes given as arguments.

+
+

-f

+
+ +

Examine the filesystem underneath mailbox, adding all directories found there as new mail- boxes. Useful for restoring mailboxes from backups.

+
+

-m

+
+ +

Rebuild the mailboxes file. Use whatever data in the existing mailboxes file it can scav-
+enge, then scans all partitions listed in the imapd.conf(5) file for additional mailboxes.

+
+ + +
+
+

FILES

/etc/imapd.conf

+ diff -ruN cyrus-imapd/doc/man/rmnews.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/rmnews.8.html --- cyrus-imapd/doc/man/rmnews.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/rmnews.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,24 @@ + + + + + +NAME
+SYNOPSIS
+rmnews
+DESCRIPTION
+FILES
+/etc/imapd.conf
+ + + + + + +

NAME

rmnews - expunge and remove news articles

+

SYNOPSIS

rmnews

DESCRIPTION

Rmnews reads article data from the standard input. It then expunges and removes the listed articles. Rmnews is designed to be used by InterNetNews to remove canceled, superseded, and expired news articles.

+

The input is processed as an INN expirerm file listing or an INN cancel stream written as a ``WC'' entry in the newsfeeds(5) file. This data consists of lines of text, each containing a list of relative article pathnames, with a sin- gle space between entries. If a listed file is contained in an IMAP news mailbox, it is expunged out of that mail- box. In any case, each listed file is unlinked.

+

Rmnews reads its configuration options out of the imapd.conf(5) file. The optional newsprefix option specifies a prefix to be prepended to newsgroup names to make the corresponding IMAP mailbox names. The required par- tition-news option specifies the pathname prefix to the IMAP news mailboxes. The value of partition-news con- catenated with the dots-to-slashes-converted value of newsprefix must be the pathname of the news spool direc- tory.

+

FILES

/etc/imapd.conf

+ diff -ruN cyrus-imapd/doc/man/syncnews.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/syncnews.8.html --- cyrus-imapd/doc/man/syncnews.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/syncnews.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,29 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+BUGS
+ + + + + + +

NAME

syncnews - synchronize IMAP news mailboxes with active file

+

SYNOPSIS

syncnews [ -C config-file ] active-file

+

DESCRIPTION

Syncnews compares the list of IMAP news mailboxes with the news active file. News mailboxes which are not listed in the active file are removed. Newsgroups listed in the active file but not in the IMAP mailboxes file have IMAP mailboxes created.

+

A newsgroup must have a status of ``y'', ``m'', or ``n'' to be considered listed in the active file.

+

Syncnews reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

-C config-file Read configuration options from config-file.

+

FILES

/etc/imapd.conf

BUGS

If a newsgroup is listed in the active file, but does not have the news spool directories created, syncnews will cre- ate those news spool directories in the process of creating the IMAP mailbox. The created directories are likely to then have ownership and permissions that do not permit the news server to write article files.
+

+ + diff -ruN cyrus-imapd/doc/man/timsieved.8.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/timsieved.8.html --- cyrus-imapd/doc/man/timsieved.8.html Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/man/timsieved.8.html Sun Jul 8 17:04:46 2001 @@ -0,0 +1,28 @@ + + + + + +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+FILES
+/etc/imapd.conf
+SEE ALSO
+ + + + + + +

NAME

timsieved - CMU hack for getting sieve scripts onto the server

+

SYNOPSIS

timsieved [ -C config-file ]

+

DESCRIPTION

timsieved is a server that allows users to remotly manage their sieve scripts kept on the server. It accepts com- mands on its standard input and responds on its standard output. It MUST be invoked by master(8) with those descriptors attached to a remote client connection.

+

Timsieved reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.

+

OPTIONS

-C config-file Read configuration options from config-file.

+

FILES

/etc/imapd.conf

SEE ALSO

imapd.conf(5), master(8)
+

+ + diff -ruN cyrus-imapd/doc/overview.html cyrus-imapd-2.0.15-HIERSEP-r2/doc/overview.html --- cyrus-imapd/doc/overview.html Sat Jul 7 20:54:14 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/doc/overview.html Sun Jul 8 16:59:59 2001 @@ -33,6 +33,10 @@
  • Mailbox Namespace +
  • Access Control Lists
    • Access Rights @@ -114,6 +118,8 @@ versions of the server may make the set of permissible characters configurable at each site. +

      Standard (Internal) Namespace

      +

      All personal mailboxes for user "bovik" begin with the string "user.bovik.". For example, if user "bovik" had a personal "work" mailbox, it would be called @@ -160,6 +166,26 @@ ".comp.infosystems.www" resolves to "cmu.comp.infosystems.www". +

      Alternate Namespace

      + +The Cyrus IMAP server can also use an alternate namespace which allows +a user's personal mailboxes to appear as if they reside at the same +level as that user's INBOX as opposed to children of it. +For example, if user "bovik" had a personal "work" +mailbox, it would appear to user "bovik" as "work" +instead of "INBOX.work" as it would in the standard namespace. + +

      The alternate namespace does NOT change the behavior of mailboxes +(as described elsewhere in this document) or how mailboxes are stored +on the filesystem. The mailboxes are always stored using their +internal namespace names and the server simply translates mailbox +names between the internal namespace names and the alternate namespace +names when used by the client in the IMAP protocol and in Sieve +scripts. + +

      All tools for administering the server, including admins using cyradm, +always use the internal namespace. +

      Access Control Lists

      Access to each mailbox is controlled by each mailbox's access control list. @@ -167,7 +193,7 @@ for specifying the users or groups of users who have permission to access the mailboxes. -

      An ACL is a list of zero or more entries. Each entry has an identifier +An ACL is a list of zero or more entries. Each entry has an identifier and a set of rights. The identifier specifies the user or group of users for which the entry applies. The set of rights is one or more letters or digits, each letter or digit conferring a particular privilege. diff -ruN cyrus-imapd/imap/Makefile.in cyrus-imapd-2.0.15-HIERSEP-r2/imap/Makefile.in --- cyrus-imapd/imap/Makefile.in Sat Jun 23 04:14:01 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/Makefile.in Sun Jul 8 16:59:59 2001 @@ -1,5 +1,5 @@ # Makefile for cyrus imap server and associated programs -# $Id: Makefile.in,v 1.137 2001/06/23 03:14:01 ken3 Exp $ +# $Id: Makefile.in,v 1.134.2.2.2.1 2001/07/08 15:59:59 ken3 Exp $ # # @configure_input@ # @@ -102,7 +102,8 @@ LOBJS= append.o mailbox.o mboxlist.o mboxname.o message.o \ config.o imap_err.o proc.o setproctitle.o convert_code.o \ duplicate.o saslclient.o acapmbox.o signals.o \ - base64.o imapparse.o telemetry.o user.o $(SEEN) $(NOTIFY) $(IDLE) + base64.o imapparse.o telemetry.o user.o namespace.o \ + $(SEEN) $(NOTIFY) $(IDLE) IMAPDOBJS=pushstats.o imapd.o index.o tls.o diff -ruN cyrus-imapd/imap/fud.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/fud.c --- cyrus-imapd/imap/fud.c Thu Feb 22 19:27:16 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/fud.c Thu May 31 05:40:42 2001 @@ -42,7 +42,7 @@ #include -/* $Id: fud.c,v 1.22 2001/02/22 19:27:16 ken3 Exp $ */ +/* $Id: fud.c,v 1.22.2.2 2001/05/31 04:40:42 ken3 Exp $ */ #ifdef HAVE_UNISTD_H #include #endif @@ -207,7 +207,7 @@ lastread = 0; lastarrived = 0; - r = mboxname_tointernal(name,who,mboxname); + r = mboxname_tointernal(name,NULL,who,mboxname); if (r) return r; /* diff -ruN cyrus-imapd/imap/idle_idled.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/idle_idled.c --- cyrus-imapd/imap/idle_idled.c Sat Jun 16 03:30:17 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/idle_idled.c Tue Jun 19 15:47:11 2001 @@ -38,7 +38,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: idle_idled.c,v 1.7 2001/06/16 02:30:17 ken3 Exp $ */ +/* $Id: idle_idled.c,v 1.5.2.1 2001/06/19 14:47:11 ken3 Exp $ */ #include #include diff -ruN cyrus-imapd/imap/imap_err.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/imap_err.c --- cyrus-imapd/imap/imap_err.c Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/imap_err.c Sun Jul 8 17:04:44 2001 @@ -0,0 +1,72 @@ +/* + * imap_err.c: + * This file is automatically generated; please do not edit it. + */ +#if defined(__STDC__) || defined(_WINDOWS) +#define NOARGS void +#else +#define NOARGS +#define const +#endif + +static const char * const text[] = { + "System I/O error", + "mail system storage has been exceeded", + "Permission denied", + "Over quota", + "Too many user flags in mailbox", + "Mailbox has an invalid format", + "Operation is not supported on mailbox", + "Mailbox does not exist", + "Mailbox already exists", + "Invalid mailbox name", + "Mailbox is locked by POP server", + "Unknown/invalid partition", + "Invalid identifier", + "Message contains NUL characters", + "Message contains bare newlines", + "Message contains non-ASCII characters in headers", + "Message contains invalid header", + "Message has no header/body separator", + "Quota root does not exist", + "Bad protocol", + "Server(s) unavailable to complete operation", + "Retry operation", + "Unrecognized character set", + "Invalid user", + "Login incorrect", + "Anonymous login is not permitted", + "Unsupported quota resource", + "Mailbox is over quota", + "Mailbox is at %d%% of quota", + "Message %d no longer exists", + "Unable to checkpoint \\Seen state", + "Unable to preserve \\Seen state", + "No matching messages", + "LOGOUT received", + "Completed", + 0 +}; + +struct error_table { + char const * const * msgs; + long base; + int n_msgs; +}; +struct et_list { + struct et_list *next; + const struct error_table * table; +}; +extern struct et_list *_et_list; + +static const struct error_table et = { text, -1904809472L, 35 }; + +static struct et_list link = { 0, 0 }; + +void initialize_imap_error_table (NOARGS) { + if (!link.table) { + link.next = _et_list; + link.table = &et; + _et_list = &link; + } +} diff -ruN cyrus-imapd/imap/imap_err.h cyrus-imapd-2.0.15-HIERSEP-r2/imap/imap_err.h --- cyrus-imapd/imap/imap_err.h Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/imap_err.h Sun Jul 8 17:04:44 2001 @@ -0,0 +1,45 @@ +/* + * imap_err.h: + * This file is automatically generated; please do not edit it. + */ +#define IMAP_IOERROR (-1904809472L) +#define IMAP_NOSPACE (-1904809471L) +#define IMAP_PERMISSION_DENIED (-1904809470L) +#define IMAP_QUOTA_EXCEEDED (-1904809469L) +#define IMAP_USERFLAG_EXHAUSTED (-1904809468L) +#define IMAP_MAILBOX_BADFORMAT (-1904809467L) +#define IMAP_MAILBOX_NOTSUPPORTED (-1904809466L) +#define IMAP_MAILBOX_NONEXISTENT (-1904809465L) +#define IMAP_MAILBOX_EXISTS (-1904809464L) +#define IMAP_MAILBOX_BADNAME (-1904809463L) +#define IMAP_MAILBOX_POPLOCKED (-1904809462L) +#define IMAP_PARTITION_UNKNOWN (-1904809461L) +#define IMAP_INVALID_IDENTIFIER (-1904809460L) +#define IMAP_MESSAGE_CONTAINSNULL (-1904809459L) +#define IMAP_MESSAGE_CONTAINSNL (-1904809458L) +#define IMAP_MESSAGE_CONTAINS8BIT (-1904809457L) +#define IMAP_MESSAGE_BADHEADER (-1904809456L) +#define IMAP_MESSAGE_NOBLANKLINE (-1904809455L) +#define IMAP_QUOTAROOT_NONEXISTENT (-1904809454L) +#define IMAP_PROTOCOL_ERROR (-1904809453L) +#define IMAP_SERVER_UNAVAILABLE (-1904809452L) +#define IMAP_AGAIN (-1904809451L) +#define IMAP_UNRECOGNIZED_CHARSET (-1904809450L) +#define IMAP_INVALID_USER (-1904809449L) +#define IMAP_INVALID_LOGIN (-1904809448L) +#define IMAP_ANONYMOUS_NOT_PERMITTED (-1904809447L) +#define IMAP_UNSUPPORTED_QUOTA (-1904809446L) +#define IMAP_NO_OVERQUOTA (-1904809445L) +#define IMAP_NO_CLOSEQUOTA (-1904809444L) +#define IMAP_NO_MSGGONE (-1904809443L) +#define IMAP_NO_CHECKSEEN (-1904809442L) +#define IMAP_NO_CHECKPRESERVE (-1904809441L) +#define IMAP_NO_NOSUCHMSG (-1904809440L) +#define IMAP_BYE_LOGOUT (-1904809439L) +#define IMAP_OK_COMPLETED (-1904809438L) +extern void initialize_imap_error_table (); +#define ERROR_TABLE_BASE_imap (-1904809472L) + +/* for compatibility with older versions... */ +#define init_imap_err_tbl initialize_imap_error_table +#define imap_err_base ERROR_TABLE_BASE_imap diff -ruN cyrus-imapd/imap/imapconf.h cyrus-imapd-2.0.15-HIERSEP-r2/imap/imapconf.h --- cyrus-imapd/imap/imapconf.h Thu Apr 26 18:17:14 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/imapconf.h Sat Apr 28 01:54:01 2001 @@ -1,5 +1,5 @@ /* config.h -- Configuration routines - $Id: imapconf.h,v 1.7 2001/04/26 17:17:14 leg Exp $ + $Id: imapconf.h,v 1.6.2.1 2001/04/28 00:54:01 ken3 Exp $ * Copyright (c) 1998-2000 Carnegie Mellon University. All rights reserved. * diff -ruN cyrus-imapd/imap/imapd.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/imapd.c --- cyrus-imapd/imap/imapd.c Fri Jul 6 02:51:20 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/imapd.c Sun Jul 8 16:59:59 2001 @@ -38,7 +38,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: imapd.c,v 1.309 2001/07/06 01:51:20 ken3 Exp $ */ +/* $Id: imapd.c,v 1.304.2.8.2.6 2001/07/08 15:59:59 ken3 Exp $ */ #include @@ -85,6 +85,7 @@ #include "idle.h" #include "telemetry.h" #include "user.h" +#include "namespace.h" #include "pushstats.h" /* SNMP interface */ @@ -123,6 +124,9 @@ static struct mailbox *imapd_mailbox; int imapd_exists; +/* current namespace */ +static struct namespace imapd_namespace; + static const char *monthname[] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" @@ -1486,10 +1490,20 @@ if (!reply) reply = "User logged in"; + prot_printf(imapd_out, "%s OK %s\r\n", tag, reply); + /* Create telemetry log */ imapd_logfd = telemetry_log(imapd_userid, imapd_in, imapd_out); - prot_printf(imapd_out, "%s OK %s\r\n", tag, reply); + /* Set namespace */ + if (!namespace_init(&imapd_namespace, imapd_userisadmin)) { + syslog(LOG_ERR, "invalid namespace prefix in configuration file"); + fatal("invalid namespace prefix in configuration file", EC_CONFIG); + } + + /* Translate userid */ + hier_sep_tointernal(imapd_userid, &imapd_namespace); + return; } @@ -1636,6 +1650,15 @@ /* Create telemetry log */ imapd_logfd = telemetry_log(imapd_userid, imapd_in, imapd_out); + /* Set namespace */ + if (!namespace_init(&imapd_namespace, imapd_userisadmin)) { + syslog(LOG_ERR, "invalid namespace prefix in configuration file"); + fatal("invalid namespace prefix in configuration file", EC_CONFIG); + } + + /* Translate userid */ + hier_sep_tointernal(imapd_userid, &imapd_namespace); + return; } @@ -2069,7 +2092,8 @@ const char *parseerr = NULL; /* Set up the append */ - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = append_setup(&mailbox, mailboxname, MAILBOX_FORMAT_NORMAL, imapd_userid, imapd_authstate, ACL_INSERT, size); @@ -2263,7 +2287,8 @@ r = IMAP_MAILBOX_NONEXISTENT; } else { - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); } if (!r) { @@ -3187,7 +3212,8 @@ char mailboxname[MAX_MAILBOX_NAME+1]; char *copyuid; - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = index_copy(imapd_mailbox, sequence, usinguid, mailboxname, ©uid); @@ -3269,13 +3295,14 @@ r = IMAP_PERMISSION_DENIED; } - if (name[0] && name[strlen(name)-1] == '.') { + if (name[0] && name[strlen(name)-1] == imapd_namespace.hier_sep) { /* We don't care about trailing hierarchy delimiters. */ name[strlen(name)-1] = '\0'; } if (!r) { - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); } if (!r) { @@ -3347,7 +3374,8 @@ int r; char mailboxname[MAX_MAILBOX_NAME+1]; - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mboxlist_deletemailbox(mailboxname, imapd_userisadmin, @@ -3355,7 +3383,8 @@ } /* was it a top-level user mailbox? */ - if (!r && !strncmp(name, "user.", 5) && !strchr(name+5, '.')) { + if (!r && + !strncmp(mailboxname, "user.", 5) && !strchr(mailboxname+5, '.')) { struct tmplist *l = xmalloc(sizeof(struct tmplist)); int r2, i; @@ -3420,8 +3449,12 @@ recursive_rename = 0; } - if (!r) r = mboxname_tointernal(oldname, imapd_userid, oldmailboxname); - if (!r) r = mboxname_tointernal(newname, imapd_userid, newmailboxname); + if (!r) + r = (*imapd_namespace.mboxname_tointernal)(oldname, &imapd_namespace, + imapd_userid, oldmailboxname); + if (!r) + r = (*imapd_namespace.mboxname_tointernal)(newname, &imapd_namespace, + imapd_userid, newmailboxname); /* if we're renaming something inside of something else, don't recursively rename stuff */ @@ -3519,14 +3552,27 @@ if (*p == '%') *p = '?'; } + /* Translate pattern */ + hier_sep_tointernal(pattern, &imapd_namespace); + if (!strcmp(namespace, "mailboxes")) { - mboxlist_findsub(pattern, imapd_userisadmin, - imapd_userid, imapd_authstate, - mailboxdata, NULL, 0); + if (imapd_namespace.isalt) + mboxlist_findsub_alt(pattern, &imapd_namespace, imapd_userisadmin, + imapd_userid, imapd_authstate, + mailboxdata, NULL, 0); + else + mboxlist_findsub(pattern, imapd_userisadmin, + imapd_userid, imapd_authstate, + mailboxdata, NULL, 0); } else if (!strcmp(namespace, "all.mailboxes")) { - mboxlist_findall(pattern, imapd_userisadmin, imapd_userid, - imapd_authstate, mailboxdata, NULL); + if (imapd_namespace.isalt) + mboxlist_findall_alt(pattern, &imapd_namespace, + imapd_userisadmin, imapd_userid, + imapd_authstate, mailboxdata, NULL); + else + mboxlist_findall(pattern, imapd_userisadmin, imapd_userid, + imapd_authstate, mailboxdata, NULL); } else if (!strcmp(namespace, "bboards") || !strcmp(namespace, "all.bboards")) { @@ -3562,13 +3608,14 @@ /* Reset state in mstringdata */ mstringdata(NULL, NULL, 0, 0); - + if (!pattern[0] && !subscribed) { /* Special case: query top-level hierarchy separator */ - prot_printf(imapd_out, "* LIST (\\Noselect) \".\" \"\"\r\n"); + prot_printf(imapd_out, "* LIST (\\Noselect) \"%c\" \"\"\r\n", + imapd_namespace.hier_sep); } else { /* Do we need to concatenate fields? */ - if (!ignorereference || pattern[0] == '.') { + if (!ignorereference || pattern[0] == imapd_namespace.hier_sep) { /* Either * - name begins with dot * - we're configured to honor the reference argument */ @@ -3583,7 +3630,8 @@ if (*reference) { /* check for LIST A. .B, change to LIST "" A.B */ - if (reference[reflen-1] == '.' && pattern[0] == '.') { + if (reference[reflen-1] == imapd_namespace.hier_sep && + pattern[0] == imapd_namespace.hier_sep) { reference[--reflen] = '\0'; } strcpy(buf, reference); @@ -3592,16 +3640,29 @@ pattern = buf; } + /* Translate pattern */ + hier_sep_tointernal(pattern, &imapd_namespace); + if (subscribed) { int force = config_getswitch("allowallsubscribe", 0); - mboxlist_findsub(pattern, imapd_userisadmin, imapd_userid, - imapd_authstate, lsubdata, NULL, force); + if (imapd_namespace.isalt) + mboxlist_findsub_alt(pattern, &imapd_namespace, + imapd_userisadmin, imapd_userid, + imapd_authstate, lsubdata, NULL, force); + else + mboxlist_findsub(pattern, imapd_userisadmin, imapd_userid, + imapd_authstate, lsubdata, NULL, force); lsubdata((char *)0, 0, 0, 0); } else { - mboxlist_findall(pattern, imapd_userisadmin, imapd_userid, - imapd_authstate, listdata, NULL); + if (imapd_namespace.isalt) + mboxlist_findall_alt(pattern, &imapd_namespace, + imapd_userisadmin, imapd_userid, + imapd_authstate, listdata, NULL); + else + mboxlist_findall(pattern, imapd_userisadmin, imapd_userid, + imapd_authstate, listdata, NULL); listdata((char *)0, 0, 0, 0); } @@ -3625,7 +3686,8 @@ if (namespace) lcase(namespace); if (!namespace || !strcmp(namespace, "mailbox")) { - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mboxlist_changesub(mailboxname, imapd_userid, imapd_authstate, add, force); @@ -3664,7 +3726,8 @@ char *acl; char *rights, *nextid; - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mboxlist_lookup(mailboxname, (char **)0, &acl, NULL); @@ -3746,7 +3809,8 @@ char *acl; char *rightsdesc; - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mboxlist_lookup(mailboxname, (char **)0, &acl, NULL); @@ -3807,7 +3871,8 @@ char *acl; char str[ACL_MAXSTR]; - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mboxlist_lookup(mailboxname, (char **)0, &acl, NULL); @@ -3853,7 +3918,8 @@ int r; char mailboxname[MAX_MAILBOX_NAME+1]; - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mboxlist_setacl(mailboxname, identifier, rights, @@ -3880,25 +3946,30 @@ int r; struct quota quota; char buf[MAX_MAILBOX_PATH]; + char mailboxname[MAX_MAILBOX_NAME+1]; - quota.root = name; quota.fd = -1; if (!imapd_userisadmin) r = IMAP_PERMISSION_DENIED; else { - mailbox_hash_quota(buf, quota.root); - quota.fd = open(buf, O_RDWR, 0); - if (quota.fd == -1) { - r = IMAP_QUOTAROOT_NONEXISTENT; - } - else { - r = mailbox_read_quota("a); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); + if (!r) { + quota.root = mailboxname; + mailbox_hash_quota(buf, quota.root); + quota.fd = open(buf, O_RDWR, 0); + if (quota.fd == -1) { + r = IMAP_QUOTAROOT_NONEXISTENT; + } + else { + r = mailbox_read_quota("a); + } } } if (!r) { prot_printf(imapd_out, "* QUOTA "); - printastring(quota.root); + printastring(name); prot_printf(imapd_out, " ("); if (quota.limit >= 0) { prot_printf(imapd_out, "STORAGE %u %d", @@ -3934,7 +4005,8 @@ int r; int doclose = 0; - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mailbox_open_header(mailboxname, imapd_authstate, &mailbox); @@ -3952,12 +4024,15 @@ prot_printf(imapd_out, "* QUOTAROOT "); printastring(name); if (mailbox.quota.root) { + (*imapd_namespace.mboxname_toexternal)(mailbox.quota.root, + &imapd_namespace, + imapd_userid, mailboxname); prot_printf(imapd_out, " "); - printastring(mailbox.quota.root); + printastring(mailboxname); r = mailbox_read_quota(&mailbox.quota); if (!r) { prot_printf(imapd_out, "\r\n* QUOTA "); - printastring(mailbox.quota.root); + printastring(mailboxname); prot_printf(imapd_out, " ("); if (mailbox.quota.limit >= 0) { prot_printf(imapd_out, "STORAGE %u %d", @@ -3996,6 +4071,7 @@ static struct buf arg; char *p; int r; + char mailboxname[MAX_MAILBOX_NAME+1]; c = prot_getc(imapd_in); if (c != '(') goto badlist; @@ -4027,7 +4103,12 @@ if (badresource) r = IMAP_UNSUPPORTED_QUOTA; else if (!imapd_userisadmin) r = IMAP_PERMISSION_DENIED; else { - r = mboxlist_setquota(quotaroot, newquota); + r = (*imapd_namespace.mboxname_tointernal)(quotaroot, &imapd_namespace, + imapd_userid, mailboxname); + + if (!r) { + r = mboxlist_setquota(mailboxname, newquota); + } } if (r) { @@ -4228,7 +4309,8 @@ index_check(imapd_mailbox, 0, 1); } - r = mboxname_tointernal(name, imapd_userid, mailboxname); + r = (*imapd_namespace.mboxname_tointernal)(name, &imapd_namespace, + imapd_userid, mailboxname); if (!r) { r = mailbox_open_header(mailboxname, imapd_authstate, &mailbox); @@ -4293,10 +4375,6 @@ * order to ensure the namespace response is correct on a server with * no shared namespace. */ -/* locations to set if the user can see a given namespace */ -#define NAMESPACE_INBOX 0 -#define NAMESPACE_USER 1 -#define NAMESPACE_SHARED 2 static int namespacedata(name, matchlen, maycreate, rock) char* name; int matchlen; @@ -4345,10 +4423,29 @@ free(pattern); } - prot_printf(imapd_out, "* NAMESPACE %s %s %s\r\n", - (sawone[NAMESPACE_INBOX]) ? "((\"INBOX.\" \".\"))" : "NIL", - (sawone[NAMESPACE_USER]) ? "((\"user.\" \".\"))" : "NIL", - (sawone[NAMESPACE_SHARED]) ? "((\"\" \".\"))" : "NIL"); + prot_printf(imapd_out, "* NAMESPACE"); + if (sawone[NAMESPACE_INBOX]) { + prot_printf(imapd_out, " ((\"%s\" \"%c\"))", + imapd_namespace.prefix[NAMESPACE_INBOX], + imapd_namespace.hier_sep); + } else { + prot_printf(imapd_out, " NIL"); + } + if (sawone[NAMESPACE_USER]) { + prot_printf(imapd_out, " ((\"%s\" \"%c\"))", + imapd_namespace.prefix[NAMESPACE_USER], + imapd_namespace.hier_sep); + } else { + prot_printf(imapd_out, " NIL"); + } + if (sawone[NAMESPACE_SHARED]) { + prot_printf(imapd_out, " ((\"%s\" \"%c\"))", + imapd_namespace.prefix[NAMESPACE_SHARED], + imapd_namespace.hier_sep); + } else { + prot_printf(imapd_out, " NIL"); + } + prot_printf(imapd_out, "\r\n"); prot_printf(imapd_out, "%s OK %s\r\n", tag, error_message(IMAP_OK_COMPLETED)); @@ -5440,7 +5537,11 @@ int maycreate; void* rock; { - prot_printf(imapd_out, "* MAILBOX %s\r\n", name); + char mboxname[MAX_MAILBOX_PATH+1]; + + (*imapd_namespace.mboxname_toexternal)(name, &imapd_namespace, + imapd_userid, mboxname); + prot_printf(imapd_out, "* MAILBOX %s\r\n", mboxname); return 0; } @@ -5454,6 +5555,7 @@ static int sawuser = 0; int lastnamehassub = 0; int c; + char mboxname[MAX_MAILBOX_PATH+1]; /* We have to reset the sawuser flag before each list command. * Handle it as a dirty hack. @@ -5466,13 +5568,17 @@ mstringdatacalls++; if (lastnamedelayed) { - if (name && strncmp(lastname, name, strlen(lastname)) == 0 && + if (name && strcasecmp(lastname, "INBOX") != 0 && + strncmp(lastname, name, strlen(lastname)) == 0 && name[strlen(lastname)] == '.') { lastnamehassub = 1; } - prot_printf(imapd_out, "* %s (%s) \".\" ", cmd, - lastnamehassub ? "" : "\\Noinferiors"); - printastring(lastname); + prot_printf(imapd_out, "* %s (%s) \"%c\" ", cmd, + lastnamehassub ? "" : "\\Noinferiors", + imapd_namespace.hier_sep); + (*imapd_namespace.mboxname_toexternal)(lastname, &imapd_namespace, + imapd_userid, mboxname); + printstring(mboxname); prot_printf(imapd_out, "\r\n"); lastnamedelayed = 0; } @@ -5507,8 +5613,11 @@ c = name[matchlen]; if (c) name[matchlen] = '\0'; - prot_printf(imapd_out, "* %s (%s) \".\" ", cmd, c ? "\\Noselect" : ""); - printstring(name); + prot_printf(imapd_out, "* %s (%s) \"%c\" ", cmd, c ? "\\Noselect" : "", + imapd_namespace.hier_sep); + (*imapd_namespace.mboxname_toexternal)(name, &imapd_namespace, + imapd_userid, mboxname); + printstring(mboxname); prot_printf(imapd_out, "\r\n"); if (c) name[matchlen] = c; return; diff -ruN cyrus-imapd/imap/imapd.h cyrus-imapd-2.0.15-HIERSEP-r2/imap/imapd.h --- cyrus-imapd/imap/imapd.h Thu Mar 15 22:56:18 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/imapd.h Tue Apr 17 23:19:07 2001 @@ -1,5 +1,5 @@ /* imapd.h -- Common state for IMAP daemon - * $Id: imapd.h,v 1.46 2001/03/15 22:56:18 leg Exp $ + * $Id: imapd.h,v 1.46.2.1 2001/04/17 22:19:07 ken3 Exp $ * * Copyright (c) 1999-2000 Carnegie Mellon University. All rights reserved. * @@ -47,6 +47,7 @@ #include "prot.h" #include "charset.h" #include "mailbox.h" +#include "namespace.h" /* Userid client has logged in as */ extern char *imapd_userid; diff -ruN cyrus-imapd/imap/index.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/index.c --- cyrus-imapd/imap/index.c Tue Jun 19 14:58:58 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/index.c Tue Jun 19 15:47:12 2001 @@ -41,7 +41,7 @@ * */ /* - * $Id: index.c,v 1.165 2001/06/19 13:58:58 ken3 Exp $ + * $Id: index.c,v 1.161.2.2 2001/06/19 14:47:12 ken3 Exp $ */ #include diff -ruN cyrus-imapd/imap/ipurge.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/ipurge.c --- cyrus-imapd/imap/ipurge.c Sat Jul 7 20:37:26 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/ipurge.c Sun Jul 8 17:00:00 2001 @@ -6,7 +6,7 @@ * * includes support for ISPN virtual host extensions * - * $Id: ipurge.c,v 1.11 2001/07/07 19:37:26 leg Exp $ + * $Id: ipurge.c,v 1.10.4.1 2001/07/08 16:00:00 ken3 Exp $ * Copyright (c) 2000 Carnegie Mellon University. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff -ruN cyrus-imapd/imap/mboxlist.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxlist.c --- cyrus-imapd/imap/mboxlist.c Sat Jun 23 04:14:02 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxlist.c Sun Jul 8 17:00:00 2001 @@ -40,7 +40,7 @@ * */ /* - * $Id: mboxlist.c,v 1.148 2001/06/23 03:14:02 ken3 Exp $ + * $Id: mboxlist.c,v 1.147.2.4.2.4 2001/07/08 16:00:00 ken3 Exp $ */ #include @@ -81,6 +81,7 @@ #include "acap.h" #include "acapmbox.h" #include "mboxname.h" +#include "namespace.h" #include "mboxlist.h" @@ -407,8 +408,16 @@ * Users by default have all access to their personal mailbox(es), * Nobody else starts with any access to same. */ - cyrus_acl_set(&acl, name+5, ACL_MODE_SET, ACL_ALL, + identifier = xstrdup(name+5); + if (config_getswitch("unixhierarchysep", 0)) { + /* Change DOTCHARs to '.' for ACL */ + for (p = identifier; *p; p++) { + if (*p == DOTCHAR) *p = '.'; + } + } + cyrus_acl_set(&acl, identifier, ACL_MODE_SET, ACL_ALL, (cyrus_acl_canonproc_t *)0, (void *)0); + free(identifier); } else { defaultacl = identifier = xstrdup(config_getstring("defaultacl", "anyone lrs")); @@ -1216,12 +1225,14 @@ struct find_rock { struct glob *g; - int inbox; + struct namespace *namespace; + int find_namespace; int inboxoffset; const char *inboxcase; const char *usermboxname; int usermboxnamelen; int checkmboxlist; + int checkshared; int isadmin; struct auth_state *auth_state; int (*proc)(char *, int, int, void *rock); @@ -1260,7 +1271,8 @@ } if (matchlen == -1) return 0; - if (!rock->inbox && rock->usermboxname && + if (rock->find_namespace != NAMESPACE_INBOX && + rock->usermboxname && keylen >= rock->usermboxnamelen && (keylen == rock->usermboxnamelen || key[rock->usermboxnamelen] == '.') && @@ -1268,7 +1280,15 @@ /* this would've been output with the inbox stuff, so skip it */ return 0; } - + + if (rock->find_namespace == NAMESPACE_SHARED && + rock->namespace && rock->namespace->isalt && + !strncmp(key, "user", 4) && + (key[4] == '\0' || key[4] == '.')) { + /* this would've been output with the user stuff, so skip it */ + return 0; + } + /* check acl */ if (!rock->isadmin) { /* check the acls */ @@ -1327,7 +1347,8 @@ memcpy(namebuf, key, keylen); namebuf[keylen] = '\0'; - if (!rock->inbox && rock->usermboxname && + if (rock->find_namespace != NAMESPACE_INBOX && + rock->usermboxname && !strncmp(namebuf, rock->usermboxname, rock->usermboxnamelen) && (keylen == rock->usermboxnamelen || namebuf[rock->usermboxnamelen] == '.')) { @@ -1357,8 +1378,18 @@ switch (r) { case 0: /* found the entry; output it */ - r = (*rock->proc)(namebuf+rock->inboxoffset, matchlen, - 1, rock->procrock); + if (rock->find_namespace == NAMESPACE_SHARED && + rock->checkshared && rock->namespace) { + /* special case: LIST "" % -- output prefix only */ + r = (*rock->proc)(rock->namespace->prefix[NAMESPACE_SHARED], + strlen(rock->namespace->prefix[NAMESPACE_SHARED])-1, + 1, rock->procrock); + /* FIXME: short-circuit this */ + } + else { + r = (*rock->proc)(namebuf+rock->inboxoffset, matchlen, + 1, rock->procrock); + } break; case IMAP_MAILBOX_NONEXISTENT: @@ -1399,10 +1430,12 @@ int prefixlen; cbrock.g = glob_init(pattern, GLOB_HIERARCHY|GLOB_INBOXCASE); + cbrock.namespace = NULL; cbrock.inboxcase = glob_inboxcase(cbrock.g); cbrock.isadmin = isadmin; cbrock.auth_state = auth_state; cbrock.checkmboxlist = 0; /* don't duplicate work */ + cbrock.checkshared = 0; cbrock.proc = proc; cbrock.procrock = rock; @@ -1468,7 +1501,7 @@ cbrock.inboxoffset = strlen(userid); } - cbrock.inbox = 1; + cbrock.find_namespace = NAMESPACE_INBOX; /* iterate through prefixes matching usermboxname */ DB->foreach(mbdb, usermboxname, usermboxnamelen, @@ -1476,7 +1509,7 @@ NULL); } - cbrock.inbox = 0; + cbrock.find_namespace = NAMESPACE_USER; cbrock.inboxoffset = 0; if (usermboxnamelen) { usermboxname[--usermboxnamelen] = '\0'; @@ -1496,6 +1529,180 @@ return r; } +int mboxlist_findall_alt(char *pattern, struct namespace *namespace, + int isadmin, char *userid, + struct auth_state *auth_state, int (*proc)(), + void *rock) +{ + struct find_rock cbrock; + char usermboxname[MAX_MAILBOX_NAME+1], patbuf[MAX_MAILBOX_NAME+1]; + int usermboxnamelen = 0; + const char *data; + int datalen; + int r = 0; + char *p; + int prefixlen, len; + + cbrock.g = glob_init(pattern, GLOB_HIERARCHY|GLOB_INBOXCASE); + cbrock.namespace = namespace; + cbrock.inboxcase = glob_inboxcase(cbrock.g); + cbrock.isadmin = isadmin; + cbrock.auth_state = auth_state; + cbrock.checkmboxlist = 0; /* don't duplicate work */ + cbrock.checkshared = 0; + cbrock.proc = proc; + cbrock.procrock = rock; + + /* Build usermboxname */ + if (userid && !strchr(userid, '.') && + strlen(userid)+5 < MAX_MAILBOX_NAME) { + strcpy(usermboxname, "user."); + strcat(usermboxname, userid); + usermboxnamelen = strlen(usermboxname); + } + else { + userid = 0; + } + + /* Check for INBOX first of all */ + if (userid) { + if (GLOB_TEST(cbrock.g, "INBOX") != -1) { + r = DB->fetch(mbdb, usermboxname, usermboxnamelen, + &data, &datalen, NULL); + if (!r && data) { + r = (*proc)(cbrock.inboxcase, 5, 0, rock); + } + } + strcpy(usermboxname+usermboxnamelen, "."); + usermboxnamelen++; + + cbrock.usermboxname = usermboxname; + cbrock.usermboxnamelen = usermboxnamelen; + } else { + cbrock.usermboxname = NULL; + cbrock.usermboxnamelen = 0; + } + + if (r) goto done; + + glob_free(&cbrock.g); + + /* Find fixed-string pattern prefix */ + for (p = pattern; *p; p++) { + if (*p == '*' || *p == '%' || *p == '?') break; + } + prefixlen = p - pattern; + + /* + * Personal (INBOX) namespace + * + * Append pattern to "INBOX.", search for those mailboxes next + */ + if (userid) { + strcpy(patbuf, "INBOX."); + strcat(patbuf, pattern); + cbrock.g = glob_init(patbuf, GLOB_HIERARCHY|GLOB_INBOXCASE); + cbrock.inboxcase = glob_inboxcase(cbrock.g); + cbrock.inboxoffset = strlen(userid); + cbrock.find_namespace = NAMESPACE_INBOX; + + /* iterate through prefixes matching usermboxname */ + DB->foreach(mbdb, + usermboxname, usermboxnamelen, + &find_p, &find_cb, &cbrock, + NULL); + + glob_free(&cbrock.g); + } + + if (usermboxnamelen) { + usermboxname[--usermboxnamelen] = '\0'; + cbrock.usermboxname = usermboxname; + cbrock.usermboxnamelen = usermboxnamelen; + } + + /* + * Other Users namespace + * + * If "Other Users*" can match pattern, search for those mailboxes next + */ + len = strlen(namespace->prefix[NAMESPACE_USER])-1; + if (!strncmp(namespace->prefix[NAMESPACE_USER], pattern, + prefixlen < len ? prefixlen : len)) { + + if (prefixlen < len) + cbrock.g = glob_init(pattern+prefixlen, GLOB_HIERARCHY); + else { + strcpy(patbuf, "user"); + strcat(patbuf, pattern+len); + cbrock.g = glob_init(patbuf, GLOB_HIERARCHY); + } + cbrock.find_namespace = NAMESPACE_USER; + cbrock.inboxoffset = 0; + + /* iterate through prefixes matching usermboxname */ + DB->foreach(mbdb, + "user", 4, + &find_p, &find_cb, &cbrock, + NULL); + + glob_free(&cbrock.g); + } + + /* + * Shared namespace + * + * search for all remaining mailboxes. + * just bother looking at the ones that have the same pattern prefix. + */ + len = strlen(namespace->prefix[NAMESPACE_SHARED]); + if (!strncmp(namespace->prefix[NAMESPACE_SHARED], pattern, + prefixlen < len - 1 ? prefixlen : len - 1)) { + + cbrock.find_namespace = NAMESPACE_SHARED; + cbrock.inboxoffset = 0; + + if (prefixlen < len) { + /* Find pattern which matches shared namespace prefix */ + for (p = pattern+prefixlen; *p; p++) { + if (*p == '%') continue; + else if (*p == '.') p++; + break; + } + + if (!*p) { + /* special case: LIST "" % -- see if we have a shared mbox */ + cbrock.g = glob_init("*", GLOB_HIERARCHY); + cbrock.checkshared = 1; + } + else { + cbrock.g = glob_init(p, GLOB_HIERARCHY); + } + + DB->foreach(mbdb, + "", 0, + &find_p, &find_cb, &cbrock, + NULL); + } + else if (pattern[len-1] == '.') { + strcpy(patbuf, ""); + strcat(patbuf, pattern+len); + cbrock.g = glob_init(patbuf, GLOB_HIERARCHY); + + pattern[prefixlen] = '\0'; + DB->foreach(mbdb, + pattern+len, prefixlen-len, + &find_p, &find_cb, &cbrock, + NULL); + } + } + + done: + glob_free(&cbrock.g); + + return r; +} + /* * Set the quota on or create a quota root */ @@ -1819,10 +2026,12 @@ int prefixlen; cbrock.g = glob_init(pattern, GLOB_HIERARCHY|GLOB_INBOXCASE); + cbrock.namespace = NULL; cbrock.inboxcase = glob_inboxcase(cbrock.g); cbrock.isadmin = 1; /* user can always see their subs */ cbrock.auth_state = auth_state; cbrock.checkmboxlist = !force; + cbrock.checkshared = 0; cbrock.proc = proc; cbrock.procrock = rock; @@ -1891,7 +2100,7 @@ cbrock.inboxoffset = strlen(userid); } - cbrock.inbox = 1; + cbrock.find_namespace = NAMESPACE_INBOX; /* iterate through prefixes matching usermboxname */ SUBDB->foreach(subs, usermboxname, usermboxnamelen, @@ -1905,7 +2114,7 @@ cbrock.usermboxnamelen = 0; } - cbrock.inbox = 0; + cbrock.find_namespace = NAMESPACE_USER; cbrock.inboxoffset = 0; if (usermboxnamelen) { usermboxname[--usermboxnamelen] = '\0'; @@ -1916,6 +2125,191 @@ just bother looking at the ones that have the same pattern prefix. */ SUBDB->foreach(subs, pattern, prefixlen, &find_p, &find_cb, &cbrock, NULL); + + done: + if (subs) mboxlist_closesubs(subs); + glob_free(&cbrock.g); + + return r; +} + +int mboxlist_findsub_alt(char *pattern, struct namespace *namespace, + int isadmin, char *userid, + struct auth_state *auth_state, + int (*proc)(), void *rock, int force) +{ + struct db *subs = NULL; + struct find_rock cbrock; + char usermboxname[MAX_MAILBOX_NAME+1], patbuf[MAX_MAILBOX_NAME+1]; + int usermboxnamelen = 0; + const char *data; + int datalen; + int r = 0; + char *p; + int prefixlen, len; + + cbrock.g = glob_init(pattern, GLOB_HIERARCHY|GLOB_INBOXCASE); + cbrock.namespace = namespace; + cbrock.inboxcase = glob_inboxcase(cbrock.g); + cbrock.isadmin = 1; /* user can always see their subs */ + cbrock.auth_state = auth_state; + cbrock.checkmboxlist = !force; + cbrock.checkshared = 0; + cbrock.proc = proc; + cbrock.procrock = rock; + + /* open the subscription file that contains the mailboxes the + user is subscribed to */ + if ((r = mboxlist_opensubs(userid, &subs)) != 0) { + goto done; + } + + /* Build usermboxname */ + if (userid && !strchr(userid, '.') && + strlen(userid)+5 < MAX_MAILBOX_NAME) { + strcpy(usermboxname, "user."); + strcat(usermboxname, userid); + usermboxnamelen = strlen(usermboxname); + } + else { + userid = 0; + } + + /* Check for INBOX first of all */ + if (userid) { + if (GLOB_TEST(cbrock.g, "INBOX") != -1) { + r = SUBDB->fetch(subs, usermboxname, usermboxnamelen, + &data, &datalen, NULL); + if (!r && data) { + r = (*proc)(cbrock.inboxcase, 5, 0, rock); + } + } + strcpy(usermboxname+usermboxnamelen, "."); + usermboxnamelen++; + + cbrock.usermboxname = usermboxname; + cbrock.usermboxnamelen = usermboxnamelen; + } + + if (r) goto done; + + glob_free(&cbrock.g); + + /* Find fixed-string pattern prefix */ + for (p = pattern; *p; p++) { + if (*p == '*' || *p == '%' || *p == '?') break; + } + prefixlen = p - pattern; + + /* + * Personal (INBOX) namespace + * + * Append pattern to "INBOX.", search for those subscriptions next + */ + if (userid) { + strcpy(patbuf, "INBOX."); + strcat(patbuf, pattern); + cbrock.g = glob_init(patbuf, GLOB_HIERARCHY|GLOB_INBOXCASE); + cbrock.inboxcase = glob_inboxcase(cbrock.g); + cbrock.inboxoffset = strlen(userid); + cbrock.find_namespace = NAMESPACE_INBOX; + + /* iterate through prefixes matching usermboxname */ + SUBDB->foreach(subs, + usermboxname, usermboxnamelen, + &find_p, &find_cb, &cbrock, + NULL); + + glob_free(&cbrock.g); + + cbrock.usermboxname = usermboxname; + cbrock.usermboxnamelen = usermboxnamelen; + } else { + cbrock.usermboxname = NULL; + cbrock.usermboxnamelen = 0; + } + + if (usermboxnamelen) { + usermboxname[--usermboxnamelen] = '\0'; + cbrock.usermboxname = usermboxname; + cbrock.usermboxnamelen = usermboxnamelen; + } + + /* + * Other Users namespace + * + * If "Other Users*" can match pattern, search for those subscriptions next + */ + len = strlen(namespace->prefix[NAMESPACE_USER])-1; + if (!strncmp(namespace->prefix[NAMESPACE_USER], pattern, + prefixlen < len ? prefixlen : len)) { + + if (prefixlen < len) + cbrock.g = glob_init(pattern+prefixlen, GLOB_HIERARCHY); + else { + strcpy(patbuf, "user"); + strcat(patbuf, pattern+len); + cbrock.g = glob_init(patbuf, GLOB_HIERARCHY); + } + cbrock.find_namespace = NAMESPACE_USER; + cbrock.inboxoffset = 0; + + /* iterate through prefixes matching usermboxname */ + SUBDB->foreach(subs, + "user", 4, + &find_p, &find_cb, &cbrock, + NULL); + + glob_free(&cbrock.g); + } + + /* + * Shared namespace + * + * search for all remaining subscriptions. + * just bother looking at the ones that have the same pattern prefix. + */ + len = strlen(namespace->prefix[NAMESPACE_SHARED]); + if (!strncmp(namespace->prefix[NAMESPACE_SHARED], pattern, + prefixlen < len - 1 ? prefixlen : len - 1)) { + + cbrock.find_namespace = NAMESPACE_SHARED; + cbrock.inboxoffset = 0; + + if (prefixlen < len) { + /* Find pattern which matches shared namespace prefix */ + for (p = pattern+prefixlen; *p; p++) { + if (*p == '%') continue; + else if (*p == '.') p++; + break; + } + + if (!*p) { + /* special case: LSUB "" % -- see if we have a shared mbox */ + cbrock.g = glob_init("*", GLOB_HIERARCHY); + cbrock.checkshared = 1; + } + else { + cbrock.g = glob_init(p, GLOB_HIERARCHY); + } + + SUBDB->foreach(subs, + "", 0, + &find_p, &find_cb, &cbrock, + NULL); + } + else if (pattern[len-1] == '.') { + strcpy(patbuf, ""); + strcat(patbuf, pattern+len); + cbrock.g = glob_init(patbuf, GLOB_HIERARCHY); + + pattern[prefixlen] = '\0'; + SUBDB->foreach(subs, + pattern+len, prefixlen-len, + &find_p, &find_cb, &cbrock, + NULL); + } + } done: if (subs) mboxlist_closesubs(subs); diff -ruN cyrus-imapd/imap/mboxlist.h cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxlist.h --- cyrus-imapd/imap/mboxlist.h Sat Jun 23 04:14:03 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxlist.h Sun Jul 8 17:00:01 2001 @@ -41,7 +41,7 @@ * * - * $Id: mboxlist.h,v 1.13 2001/06/23 03:14:03 ken3 Exp $ + * $Id: mboxlist.h,v 1.12.4.1.2.1 2001/07/08 16:00:01 ken3 Exp $ */ #ifndef INCLUDED_MBOXLIST_H @@ -52,6 +52,7 @@ #include "auth.h" #include "acap.h" #include "mailbox.h" +#include "namespace.h" /* --- cut here --- */ #define CONFIG_DB_SUBS (&cyrusdb_flat) @@ -115,11 +116,19 @@ /* Find all mailboxes that match 'pattern'. */ int mboxlist_findall(char *pattern, int isadmin, char *userid, struct auth_state *auth_state, int (*proc)(), void *rock); +int mboxlist_findall_alt(char *pattern, struct namespace *namespace, + int isadmin, char *userid, + struct auth_state *auth_state, int (*proc)(), + void *rock); /* Find subscribed mailboxes that match 'pattern'. */ int mboxlist_findsub(char *pattern, int isadmin, char *userid, struct auth_state *auth_state, int (*proc)(), void *rock, int force); +int mboxlist_findsub_alt(char *pattern, struct namespace *namespace, + int isadmin, char *userid, + struct auth_state *auth_state, int (*proc)(), + void *rock, int force); /* given a mailbox 'name', where should we stage messages for it? 'stagedir' should be MAX_MAILBOX_PATH. */ diff -ruN cyrus-imapd/imap/mboxname.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxname.c --- cyrus-imapd/imap/mboxname.c Fri Jan 5 06:00:18 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxname.c Wed Jul 4 14:59:29 2001 @@ -1,5 +1,5 @@ /* mboxname.c -- Mailbox list manipulation routines - $Id: mboxname.c,v 1.20 2001/01/05 06:00:18 leg Exp $ + $Id: mboxname.c,v 1.20.4.2.2.3 2001/07/04 13:59:29 ken3 Exp $ * Copyright (c)1998-2000 Carnegie Mellon University. All rights reserved. * @@ -102,30 +102,179 @@ * On success, results are placed in the buffer pointed to by * 'result', the buffer must be of size MAX_MAILBOX_NAME+1. */ -int mboxname_tointernal(const char *name, const char *userid, char *result) +int mboxname_tointernal(const char *name, struct namespace *namespace, + const char *userid, char *result) { + /* Personal (INBOX) namespace */ if ((name[0] == 'i' || name[0] == 'I') && !strncasecmp(name, "inbox", 5) && - (name[5] == '\0' || name[5] == '.')) { + (name[5] == '\0' || name[5] == namespace->hier_sep)) { - if (!userid || strchr(userid, '.')) { + if (!userid || strchr(userid, namespace->hier_sep)) { return IMAP_MAILBOX_BADNAME; } - if (strlen(name)+strlen(userid)+5 > MAX_MAILBOX_NAME) { + if (strlen(name+5)+strlen(userid)+5 > MAX_MAILBOX_NAME) { return IMAP_MAILBOX_BADNAME; } strcpy(result, "user."); strcat(result, userid); strcat(result, name+5); + hier_sep_tointernal(result+5+strlen(userid), namespace); return 0; } - + + /* Other Users & Shared namespace */ if (strlen(name) > MAX_MAILBOX_NAME) { return IMAP_MAILBOX_BADNAME; } strcpy(result, name); + hier_sep_tointernal(result, namespace); + return 0; +} + +int mboxname_tointernal_alt(const char *name, struct namespace *namespace, + const char *userid, char *result) +{ + int prefixlen; + + /* Shared namespace */ + prefixlen = strlen(namespace->prefix[NAMESPACE_SHARED]); + if (!strncmp(name, namespace->prefix[NAMESPACE_SHARED], prefixlen-1) && + (name[prefixlen-1] == '\0' || name[prefixlen-1] == namespace->hier_sep)) { + + if (name[prefixlen-1] == '\0') { + /* can't create folders using undelimited prefix */ + return IMAP_MAILBOX_BADNAME; + } + + if (strlen(name+prefixlen) > MAX_MAILBOX_NAME) { + return IMAP_MAILBOX_BADNAME; + } + + strcpy(result, name+prefixlen); + hier_sep_tointernal(result, namespace); + return 0; + } + + /* Other Users namespace */ + prefixlen = strlen(namespace->prefix[NAMESPACE_USER]); + if (!strncmp(name, namespace->prefix[NAMESPACE_USER], prefixlen-1) && + (name[prefixlen-1] == '\0' || name[prefixlen-1] == namespace->hier_sep)) { + + if (name[prefixlen-1] == '\0') { + /* can't create folders using undelimited prefix */ + return IMAP_MAILBOX_BADNAME; + } + + if (strlen(name+prefixlen)+5 > MAX_MAILBOX_NAME) { + return IMAP_MAILBOX_BADNAME; + } + + strcpy(result, "user."); + strcat(result, name+prefixlen); + hier_sep_tointernal(result+5, namespace); + return 0; + } + + /* Personal (INBOX) namespace */ + if (!userid || strchr(userid, namespace->hier_sep)) { + return IMAP_MAILBOX_BADNAME; + } + + if (strlen(userid)+5 > MAX_MAILBOX_NAME) { + return IMAP_MAILBOX_BADNAME; + } + + strcpy(result, "user."); + strcat(result, userid); + + /* INBOX */ + if ((name[0] == 'i' || name[0] == 'I') && + !strncasecmp(name, "inbox", 5) && + (name[5] == '\0' || name[5] == namespace->hier_sep)) { + + if (name[5] == namespace->hier_sep) { + /* can't create folders under INBOX */ + return IMAP_MAILBOX_BADNAME; + } + + return 0; + } + + /* other personal folder */ + if (strlen(result)+6 > MAX_MAILBOX_NAME) { + return IMAP_MAILBOX_BADNAME; + } + strcat(result, "."); + strcat(result, name); + hier_sep_tointernal(result+6+strlen(userid), namespace); + return 0; +} + +/* + * Convert the internal mailbox 'name' to an external name. + * If 'userid' is non-null, it is the name of the current user. + * On success, results are placed in the buffer pointed to by + * 'result', the buffer must be of size MAX_MAILBOX_NAME+1. + */ +int mboxname_toexternal(const char *name, struct namespace *namespace, + const char *userid, char *result) +{ + strcpy(result, name); + hier_sep_toexternal(result, namespace); + return 0; +} + +int mboxname_toexternal_alt(const char *name, struct namespace *namespace, + const char *userid, char *result) +{ + /* Personal (INBOX) namespace */ + if (!strncasecmp(name, "inbox", 5) && + (name[5] == '\0' || name[5] == '.')) { + if (name[5] == '\0') + strcpy(result, name); + else + strcpy(result, name+6); + } + /* paranoia - this shouldn't be needed */ + else if (!strncmp(name, "user.", 5) && + !strncmp(name+5, userid, strlen(userid)) && + (name[5+strlen(userid)] == '\0' || + name[5+strlen(userid)] == '.')) { + if (name[5+strlen(userid)] == '\0') + strcpy(result, "INBOX"); + else + strcpy(result, name+5+strlen(userid)+1); + } + + /* Other Users namespace */ + else if (!strncmp(name, "user", 4) && + (name[4] == '\0' || name[4] == '.')) { + sprintf(result, "%.*s", + strlen(namespace->prefix[NAMESPACE_USER])-1, + namespace->prefix[NAMESPACE_USER]); + if (name[4] == '.') { + sprintf(result+strlen(result), "%c%s", + namespace->hier_sep, name+5); + } + } + + /* Shared namespace */ + else { + /* special case: LIST/LSUB "" % */ + if (!strncmp(name, namespace->prefix[NAMESPACE_SHARED], + strlen(namespace->prefix[NAMESPACE_SHARED])-1)) { + strcpy(result, name); + } + else { + strcpy(result, namespace->prefix[NAMESPACE_SHARED]); + strcat(result, name); + } + } + + hier_sep_toexternal(result, namespace); return 0; } @@ -192,6 +341,9 @@ int sawutf7 = 0; unsigned c1, c2, c3, c4, c5, c6, c7, c8; int ucs4; + int unixsep; + + unixsep = config_getswitch("unixhierarchysep", 0); if (strlen(name) > MAX_MAILBOX_NAME) return IMAP_MAILBOX_BADNAME; for (i = 0; i < NUM_BADMBOXPATTERNS; i++) { @@ -270,7 +422,9 @@ name++; /* Skip over terminating '-' */ } else { - if (!strchr(GOODCHARS, *name++)) return IMAP_MAILBOX_BADNAME; + if (!strchr(GOODCHARS, *name) && !(unixsep && *name == DOTCHAR)) + return IMAP_MAILBOX_BADNAME; + name++; sawutf7 = 0; } } diff -ruN cyrus-imapd/imap/mboxname.h cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxname.h --- cyrus-imapd/imap/mboxname.h Fri Jan 5 06:00:18 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/mboxname.h Thu May 31 05:40:47 2001 @@ -1,5 +1,5 @@ /* mboxname.h -- Mailbox list manipulation routines - * $Id: mboxname.h,v 1.5 2001/01/05 06:00:18 leg Exp $ + * $Id: mboxname.h,v 1.5.4.2 2001/05/31 04:40:47 ken3 Exp $ * * Copyright (c) 1999-2000 Carnegie Mellon University. All rights reserved. * @@ -44,7 +44,16 @@ #ifndef INCLUDED_MBOXNAME_H #define INCLUDED_MBOXNAME_H -int mboxname_tointernal(const char *name, const char *userid, char *result); +#include "namespace.h" + +int mboxname_tointernal(const char *name, struct namespace *namespace, + const char *userid, char *result); +int mboxname_tointernal_alt(const char *name, struct namespace *namespace, + const char *userid, char *result); +int mboxname_toexternal(const char *name, struct namespace *namespace, + const char *userid, char *result); +int mboxname_toexternal_alt(const char *name, struct namespace *namespace, + const char *userid, char *result); int mboxname_userownsmailbox(char *userid, char *name); int mboxname_netnewscheck(char *name); int mboxname_policycheck(char *name); diff -ruN cyrus-imapd/imap/mupdate.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/mupdate.c --- cyrus-imapd/imap/mupdate.c Sat Jul 7 20:42:59 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/mupdate.c Sun Jul 8 17:00:01 2001 @@ -879,7 +879,7 @@ /* just grab the update list and release the lock */ p = C->plist; C->plist = NULL; - pthread_mutex_unlock(&C-m); + pthread_mutex_unlock(&C->m); while (p != NULL) { /* send update */ diff -ruN cyrus-imapd/imap/namespace.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/namespace.c --- cyrus-imapd/imap/namespace.c Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/namespace.c Wed Jul 4 14:59:30 2001 @@ -0,0 +1,130 @@ +/* namespace.c -- Namespace manipulation routines + * $Id: namespace.c,v 1.1.2.4.2.3 2001/07/04 13:59:30 ken3 Exp $ + * + * Copyright (c) 1999-2000 Carnegie Mellon University. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any other legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include + +#include + +#include "imapconf.h" +#include "mboxname.h" +#include "namespace.h" + +/* + * Create namespace based on config options. + */ +int namespace_init(struct namespace *namespace, int force_std) +{ + const char *prefix; + + namespace->hier_sep = config_getswitch("unixhierarchysep", 0) ? '/' : '.'; + namespace->isalt = !force_std && config_getswitch("altnamespace", 0); + + if (namespace->isalt) { + /* alternate namespace */ + strcpy(namespace->prefix[NAMESPACE_INBOX], ""); + + prefix = config_getstring("userprefix", "Other Users"); + if (!prefix || strlen(prefix) == 0 || + strlen(prefix) >= MAX_NAMESPACE_PREFIX || + strchr(prefix,namespace->hier_sep) != NULL) + return 0; + sprintf(namespace->prefix[NAMESPACE_USER], "%.*s%c", + MAX_NAMESPACE_PREFIX-1, prefix, namespace->hier_sep); + + prefix = config_getstring("sharedprefix", "Shared Folders"); + if (!prefix || strlen(prefix) == 0 || + strlen(prefix) >= MAX_NAMESPACE_PREFIX || + strchr(prefix, namespace->hier_sep) != NULL || + !strncmp(namespace->prefix[NAMESPACE_USER], prefix, strlen(prefix))) + return 0; + sprintf(namespace->prefix[NAMESPACE_SHARED], "%.*s%c", + MAX_NAMESPACE_PREFIX-1, prefix, namespace->hier_sep); + + namespace->mboxname_tointernal = mboxname_tointernal_alt; + namespace->mboxname_toexternal = mboxname_toexternal_alt; + } + + else { + /* standard namespace */ + sprintf(namespace->prefix[NAMESPACE_INBOX], "%s%c", + "INBOX", namespace->hier_sep); + sprintf(namespace->prefix[NAMESPACE_USER], "%s%c", + "user", namespace->hier_sep); + strcpy(namespace->prefix[NAMESPACE_SHARED], ""); + + namespace->mboxname_tointernal = mboxname_tointernal; + namespace->mboxname_toexternal = mboxname_toexternal; + } + + return 1; +} + +char *hier_sep_tointernal(char *name, struct namespace *namespace) +{ + char *p; + + if (namespace->hier_sep == '/') { + /* change all '/'s to '.' and all '.'s to DOTCHAR */ + for (p = name; *p; p++) { + if (*p == '/') *p = '.'; + else if (*p == '.') *p = DOTCHAR; + } + } + + return name; +} + +char *hier_sep_toexternal(char *name, struct namespace *namespace) +{ + char *p; + + if (namespace->hier_sep == '/') { + /* change all '.'s to '/' and all DOTCHARs to '.' */ + for (p = name; *p; p++) { + if (*p == '.') *p = '/'; + else if (*p == DOTCHAR) *p = '.'; + } + } + + return name; +} diff -ruN cyrus-imapd/imap/namespace.h cyrus-imapd-2.0.15-HIERSEP-r2/imap/namespace.h --- cyrus-imapd/imap/namespace.h Thu Jan 1 01:00:00 1970 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/namespace.h Wed Jul 4 02:37:01 2001 @@ -0,0 +1,70 @@ +/* namespace.h -- Namespace manipulation routines + * $Id: namespace.h,v 1.1.2.3.2.2 2001/07/04 01:37:01 ken3 Exp $ + * + * Copyright (c) 1999-2000 Carnegie Mellon University. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any other legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#ifndef INCLUDED_NAMESPACE_H +#define INCLUDED_NAMESPACE_H + +#define MAX_NAMESPACE_PREFIX 40 + +#define DOTCHAR '^' + +enum { NAMESPACE_INBOX, NAMESPACE_USER, NAMESPACE_SHARED }; + +struct namespace { + int isalt; + char prefix[3][MAX_NAMESPACE_PREFIX+1]; + char hier_sep; + int (*mboxname_tointernal)(const char *name, struct namespace *namespace, + const char *userid, char *result); + int (*mboxname_toexternal)(const char *name, struct namespace *namespace, + const char *userid, char *result); +}; + +/* Initialize namespace (prefixes & hierarchy separator from imapd.conf) */ +int namespace_init(struct namespace *namespace, int force_std); + +char *hier_sep_tointernal(char *name, struct namespace *namespace); + +char *hier_sep_toexternal(char *name, struct namespace *namespace); + +#endif diff -ruN cyrus-imapd/imap/pop3d.c cyrus-imapd-2.0.15-HIERSEP-r2/imap/pop3d.c --- cyrus-imapd/imap/pop3d.c Sat Jul 7 00:26:10 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/pop3d.c Sun Jul 8 17:00:02 2001 @@ -40,7 +40,7 @@ */ /* - * $Id: pop3d.c,v 1.98 2001/07/06 23:26:10 ken3 Exp $ + * $Id: pop3d.c,v 1.90.2.3.2.3 2001/07/08 16:00:02 ken3 Exp $ */ #include @@ -82,6 +82,7 @@ #include "mboxlist.h" #include "idle.h" #include "telemetry.h" +#include "namespace.h" #ifdef HAVE_KRB /* kerberos des is purported to conflict with OpenSSL DES */ @@ -130,6 +131,9 @@ static mailbox_decideproc_t expungedeleted; +/* current namespace */ +static struct namespace popd_namespace; + static void cmd_apop(char *user, char *digest); static int apop_enabled(void); static char popd_apop_chal[300]; /* timestamp (44) + config_servername (256) */ @@ -233,6 +237,12 @@ /* setup for sending IMAP IDLE notifications */ idle_enabled(); + /* Set namespace */ + if (!namespace_init(&popd_namespace, 0)) { + syslog(LOG_ERR, "invalid namespace prefix in configuration file"); + fatal("invalid namespace prefix in configuration file", EC_CONFIG); + } + while ((opt = getopt(argc, argv, "C:sk")) != EOF) { switch(opt) { case 'C': /* alt config file - handled by service::main() */ @@ -934,7 +944,8 @@ shut_down(0); } else if (!(p = auth_canonifyid(user)) || - strchr(p, '.') || strlen(p) + 6 > MAX_MAILBOX_PATH) { + (popd_namespace.hier_sep == '.' && strchr(p, '.')) || + strlen(p) + 6 > MAX_MAILBOX_PATH) { prot_printf(popd_out, "-ERR Invalid user\r\n"); syslog(LOG_NOTICE, "badlogin: %s plaintext %s invalid user", @@ -1216,6 +1227,9 @@ int minpoll; popd_login_time = time(0); + + /* Translate userid */ + hier_sep_tointernal(popd_userid, &popd_namespace); strcpy(inboxname, "user."); strcat(inboxname, popd_userid); diff -ruN cyrus-imapd/imap/version.h cyrus-imapd-2.0.15-HIERSEP-r2/imap/version.h --- cyrus-imapd/imap/version.h Sat Jul 7 20:54:14 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/imap/version.h Sun Jul 8 17:00:02 2001 @@ -36,10 +36,10 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * $Id: version.h,v 1.105 2001/07/07 19:54:14 leg Exp $ + * $Id: version.h,v 1.102.2.4.2.2 2001/07/08 16:00:02 ken3 Exp $ */ -#define _CYRUS_VERSION "v2.0.15" +#define _CYRUS_VERSION "v2.0.15-HIERSEP-r2" /* EXTRA_IDENT is a hack to add some version information for which compile * was used to build this version (at CMU, but we don't care what you do with diff -ruN cyrus-imapd/man/imapd.conf.5 cyrus-imapd-2.0.15-HIERSEP-r2/man/imapd.conf.5 --- cyrus-imapd/man/imapd.conf.5 Sat Jun 23 02:01:50 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/man/imapd.conf.5 Sun Jul 8 17:00:02 2001 @@ -74,6 +74,25 @@ partition named in the \fBdefaultpartition\fR option, is required. For example, if the value of the \fBdefaultpartion\fR option is \fBdefault\fR, then the \fBpartition-default\fR field is required. +.IP "\fBunixhierarchysep:\fR no" 5 +Use the UNIX separator character '/' for delimiting levels of mailbox +hierarchy. The default is to use the netnews separator character '.'. +.IP "\fBaltnamespace:\fR no" 5 +Use the alternate IMAP namespace, where personal folders reside at the +same level in the hierarchy as INBOX. +.br +.sp +This option ONLY applies where interaction takes place with the +client/user. Currently this is limited to the IMAP protocol (imapd) +and Sieve scripts (lmtpd). This option does NOT apply to admin tools +such as cyradm (admins ONLY), reconstruct, quota, etc., NOR does it +affect LMTP delivery of messages directly to mailboxes via plus-addressing. +.IP "\fBuserprefix:\fR Other Users" 5 +If using the alternate IMAP namespace, the prefix for the other users +namespace. The hierarchy delimiter will be automatically appended. +.IP "\fBsharedprefix:\fR Shared Folders" 5 +If using the alternate IMAP namespace, the prefix for the shared +namespace. The hierarchy delimiter will be automatically appended. .IP "\fBumask:\fR 077" 5 The umask value used by various Cyrus IMAP programs. .IP "\fBservername:\fR " 5 diff -ruN cyrus-imapd/master/Makefile.in cyrus-imapd-2.0.15-HIERSEP-r2/master/Makefile.in --- cyrus-imapd/master/Makefile.in Sat Apr 28 15:40:33 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/master/Makefile.in Thu May 31 15:46:31 2001 @@ -1,5 +1,5 @@ # Makefile for the Cyrus controlling process -# $Id: Makefile.in,v 1.11 2001/04/28 14:40:33 ken3 Exp $ +# $Id: Makefile.in,v 1.10.4.1 2001/05/31 14:46:31 ken3 Exp $ # # @configure_input@ # diff -ruN cyrus-imapd/master/master.c cyrus-imapd-2.0.15-HIERSEP-r2/master/master.c --- cyrus-imapd/master/master.c Sat Jun 23 01:59:48 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/master/master.c Sun Jul 8 17:00:02 2001 @@ -39,7 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: master.c,v 1.40 2001/06/23 00:59:48 ken3 Exp $ */ +/* $Id: master.c,v 1.35.2.2.2.1 2001/07/08 16:00:02 ken3 Exp $ */ #include @@ -326,16 +326,19 @@ if ((port = parse_listen(listen)) == NULL) { /* listen IS the port */ if (!resolve_port(listen, s, &sin)) { + free(listen); return; } sin.sin_addr.s_addr = INADDR_ANY; } else { /* listen is now just the address */ if (!resolve_port(port, s, &sin)) { + free(listen); return; } if (!resolve_host(listen, &sin)) { s->exec = NULL; + free(listen); return; } } diff -ruN cyrus-imapd/master/service.c cyrus-imapd-2.0.15-HIERSEP-r2/master/service.c --- cyrus-imapd/master/service.c Mon May 21 21:10:17 2001 +++ cyrus-imapd-2.0.15-HIERSEP-r2/master/service.c Thu May 31 15:46:32 2001 @@ -39,7 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: service.c,v 1.23 2001/05/21 20:10:17 leg Exp $ */ +/* $Id: service.c,v 1.21.2.1 2001/05/31 14:46:32 ken3 Exp $ */ #include #include