This section describes what the main Netscape Messaging Server command-line utilities do, defines their syntax, and gives examples of how they are used. The utilities are listed in alphabetical order.
configutil
The configutil utility enables you to list and change Messaging Server configuration options.
Most Messaging Server configuration options and values are stored in the LDAP database on Directory Server with the remaining options and values stored locally on Messaging Server in a file named configdb (for details, see Location of Configuration Data).
Note: If the administrator has defined any language-specific options (such as messages), you must use the language option at the end of the command in order to list or change them. Commands entered without a language option are only applied to attributes that do not have a specified language parameter.
configutil Syntaxconfigutil [-f configdbfile] [command-options] [;language]
configutil -i < inputfile
Requirements: Must be run locally on the Messaging server.
Location: server-root/bin/msg/admin/bin
You can use configutil to perform four tasks:
If you specify no command-line options, all configuration options are listed.
Using the getconf and setconf Scripts
You can use the getconf and setconf scripts to more easily perform simple configutil tasks. These scripts use the following syntax to call configutil to perform these tasks:
To display the entire configuration database:
getconf
To display the value of a specified option:
getconf option
To set a specified option to a specified value:
setconf option value
To clear a specified option's value (that is, reset the option so that it has no value):
setconf option ""
For example, to set the value of the service.smtp.port configuration option to 25:
setconf service.smtp.port 25
To use setconf to set an SMTP banner with the text: "Welcome to Airius"
setconf service.smtp.banner "Welcome to Airius"
To use setconf to clear an SMTP banner:
setconf service.smtp.banner ""
You cannot use prefix pattern matching or language-specific values with these scripts.
Examples of Ways to Use configutil
To list all configuration options and their values in the both the Directory Server LDAP database and local server configuration file:
configutil
To import configurations from an input file named config.cfg:
configutil -i < config.cfg
To list all configuration options with the prefix service.imap:
configutil -p service.imap
To list all configuration options with the prefix service.imap, including those with empty values:
configutil -e -p service.imap
To display the value of the service.smtp.port configuration option:
configutil -o service.smtp.port
To set the value of the service.smtp.port configuration option to 25:
configutil -o service.smtp.port -v 25
To clear the value for the service.imap.banner configuration option:
configutil -o service.imap.banner -v ""
For information on using configutil to set alarm attributes, see Alarm Attributes.
Language Specific Options
To list or set options for a specific language, append ;lang-xx immediately after the option with no spaces, where xx is the two-letter language identifier. For example, to view the text of the Japanese version of the store.quotaexceededmsg message:
configutil -o "store.quotaexceededmsg;lang-jp"
counterutil
The counterutil utility displays and changes counters in a counter object. It can also be used to monitor a counter object every 5 seconds.
counterutil Syntaxcounterutil -o counterobject [-r registryname]
Requirements: Must be run locally on the Messaging server.
Location: server-root/bin/msg/admin/bin
Examples of Ways to Use counterutil
To list all counter objects in a given server's counter registry:
counterutil
To display the content of counter object imapstat every 5 seconds:
counterutil -o imapstat -r server-root/msg-instance/counter/counter
deliver
The deliver utility delivers mail directly to the message store accessible by IMAP or POP mail clients.
If you are administering an integrated messaging environment, you can use this utility to deliver mail from another MTA, a sendmail MTA for example, to the Messaging Server message store.
deliver Syntaxdeliver [-l] [-d] [-r address] [-f address] [-m mailbox] [-a authid]
[-q] [-F flag]...[userid]...
Requirements: Must be run locally on the Messaging server; the stored utility must also be running.
Location on Unix: server-root/bin/msg/store/bin
Location on NT: server-root/bin/msg/admin/bin
If you specify no options, mail is delivered to the inbox.
Examples of Ways to Use deliver
To deliver the contents of a file named message.list to Fred's Tasks mailbox:
deliver -m tasks fred < message.list
In this example, if the tasks mailbox does not grant "p" rights to the sender, the contents of message.list are delivered to the inbox of the user fred.
hashdir
The hashdir utility identifies the directory that contains the message store for a particular account. This utility reports the relative path to the message store, such as d1/a7/. The path is relative to the directory level just before the one based on the user ID. The utility sends the path information to the standard output.
hashdir Syntaxhashdir [-a] [-i] account_name
Requirements: Must be run locally on the Messaging server.
Location: server-root/bin/msg/admin/bin
imscripter
The imscripter utility connects to an IMAP server and executes a command or a sequence of commands.
imscripter Syntaximscripter [-h] [-f script | [-c command] -f datafile]] [-c command]
[-s serverid | -p port | -u userid | -x passwd |-v verbosity]
Requirements: May be run remotely.
Location: server-root/bin/msg/admin/bin
imscripter File Formats
Data files used with the -f option have to be formatted as a list of mailboxes with fully qualified paths, one mailbox per line. For example:
shared folders/paco/INBOX
shared folders/desmond/INBOX
shared folders/percival/INBOX
Scripts used with the -f option have to be in the following format:
command options
For example, an imscripter script file that adds the mailboxes contained in a file named add.list, and deletes mailboxes contained in a file named delete.list, looks like this:
create -f add.list
delete -f delete.list
Suppose the example file shown above is named dothis.script. To run it showing only errors, input commands, BAD and NO untagged and completion responses, enter:
imscripter -v ECBb -f dothis.script
Examples of Ways to Use imscripter
To run imscripter in interactive mode:
imscripter [options]
In interactive mode, each command is entered one line at a time at the imscripter prompt. The command is then executed and responses displayed.
To execute the commands specified in a script file:
imscripter [options] -f script
To execute a specific command on mailbox:
imscripter [options] [-l] -c command mailbox
To execute a specific command for each line of data in a data file:
imscripter [options] -c command -f datafile
To execute commands from the specified script file:
imscripter -s username.airius.com -f script
mailq
The mailq utility checks and reports on the queue of messages awaiting delivery.
mailq Syntaxmailq [-v]
Requirements: Must be locally run on the server.
Location on Unix: /bin/mailq
Location on NT: server-root/bin/msg/admin/bin
mailq Examples
To check the mail queue, type mailq at a command prompt. If there are no queued messages, that fact will be reported:
% mailq
Mail queue is empty.
If there are queued messages, each host that has queued messages waiting to be delivered will be listed, along with the number of pending deliveries. For example, output might look like this:
% mailq
Queued Messages Destination Host
--------------- ----------------
2 math.marsu.edu
3 universal-robots.com
In the example above, five messages are waiting for delivery. Delivering all of them should require two connections to other machines because the messaging server attempts to deliver all queued mail for a host before disconnecting.
For information how to manually force immediate delivery of messages in the mail queue, see processq.
mboxutil
The mboxutil utility lists, creates, deletes, renames, or moves mailboxes (folders).
mboxutil Syntaxmboxutil [-c mailbox] [-d mailbox] [-r oldname newname [partition]]
[-l] [-p pattern] [-x] [-k] [-u]
Requirements: Must be run locally on the Messaging server; the stored utility must also be running.
Location: server-root/bin/msg/admin/bin
Mailbox Naming Conventions. You must specify mailbox names in the following format: user/userid/mailbox, where userid it the user that owns the mailbox and mailbox is the name of the mailbox. For example, the following command creates the mailbox named INBOX for the user whose user ID is crowe. INBOX is the default mailbox for mail delivered to the user crowe.
mboxutil -c user/crowe/INBOX
Important: The name INBOX is reserved for each user's default mailbox. INBOX is the only folder name that is case-insensitive. All other folder names are case-sensitive.
Examples of Ways to Use mboxutil
To list all mailboxes for all users:
mboxutil -l
To list all mailboxes and also include path and acl information:
mboxutil -l -x
To create the default mailbox named INBOX for the user daphne:
mboxutil -c user/daphne/INBOX
To delete a mail folder named projx for the user delilah:
mboxutil -d user/delilah/projx
To delete the default mailbox named INBOX and all mail folders for the user druscilla:
mboxutil -d user/druscilla/INBOX
To rename Desdemona's mail folder from memos to memos-april:
mboxutil -r user/desdemona/memos user/desdemona/memos-april
To lock a mail folder named legal for the user dulcinea:
mboxutil -k user/dulcinea/legal cmd
where cmd is the command you wish to run on the locked mail folder.
To move the mail account for the user dimitria to a new partition:
mboxutil -r user/dimitria/INBOX user/dimitria/INBOX partition
where partition specifies the name of the new partition.
To move the mail folder named personal for the user dimitria to a new partition:
mboxutil -r user/dimitria/personal user/dimitria/personal partition
To list usage statistics:
mboxutil -u
quota use %use user
10240 297 29% daphne
no quota 168 delilah
no quota 0 druscilla
Quotas and usage figures are reported in kilobytes.
MoveUser
The MoveUser utility moves a user's account from one messaging server to another. When user accounts are moved from one messaging server to another, it's also necessary to move the user's mailboxes and the messages they contain from one server to the other. In addition to moving mailboxes from one server to another, MoveUser updates entries in the Directory Server to reflect the user's new mailhost name and message store path.
MoveUser SyntaxMoveUser -s srcmailhost[:port] -x proxyuser -p password
[-u uid | -u uid -U newuid] [-l ldapURL -D bindDN -w password]
-d destmailhost[:port] [options]
Requirements: May be run remotely.
Location: server-root/bin/msg/admin/bin
Table A.11 MoveUser options
Option
| Description
|
-a destproxyuser
|
ProxyAuth user for destination messaging server.
|
-A
|
Do not add an alternate email address to the LDAP entry.
|
-d destmailhost
|
Destination messaging server. By default, MoveUser assumes IMAP port 143. To specify a different port, add a semi-colon and the port number after destmailhost. For example, to specify port 150 for myhost, you would enter -d myhost:150.
|
-D binddn
|
Binding dn to the given ldapURL.
|
-F
|
Delete messages in source messaging server after successful move of mailbox. (If not specified, messages will be left in source messaging server.)
|
-h
|
Display help for this command.
|
-l ldapURL
|
URL to establish a connection with the Directory Server:
ldap://hostname:port/base_dn?attributes?scope?filter
For more information about specifying an LDAP URL, see your Directory Server documentation. Cannot be used with the -u option.
|
-L
|
Add a license for Messaging Server if not already set.
|
-m destmaildrop
|
Message store path for destination messaging server. (If not specified, the default is used.)
|
-n msgcount
|
Number of messages to be moved at once.
|
-o srcmaildrop
|
Message store path for source messaging server. (If not specified, the default is used.)
|
-p srcproxypasswd
|
ProxyAuth password for source messaging server.
|
-s srcmailhost
|
Source messaging server. By default, MoveUser assumes IMAP port 143. To specify a different port, add a semi-colon and the port number after srcmailhost. For example, to specify port 150 for myhost, you would enter -s myhost:150.
|
-S
|
Do not set new message store path for each user.
|
-u uid
|
User ID for the user mailbox that is to be moved. Cannot be used with -l option.
|
-U newuid
|
New (renamed) user ID that the mailbox is to be moved to. Must be used with -u uid, where -u uid, identifies the old user name that is to be discontinued. Both the old and the new user ID must currently exist on both the source and the destination mailhost. After migration you are free to manually remove the original user ID from LDAP if you wish to do so.
|
-v destproxypwd
|
ProxyAuth password for destination messaging server.
|
-w bindpasswd
|
Binding password for the binddn given in the -D option.
|
-x srcproxyuser
|
ProxyAuth user for source messaging server.
|
ProxyAuth User
The ProxyAuth user is the user given the privilege to run the MoveUser command. In older Messaging Server 3.x environments the user ID of the Proxyauth user was specified in the file: /etc/netscape.mail.conf. In Messaging Server 4.x environments, any valid Message Store Administrator can be used to run the MoveUser command as the ProxyAuth user. The list of Message Store Administrators can be viewed and edited from the Netscape Console. For more information, see Specifying Administrator Access to the Store.
Examples of Ways to Use MoveUser
To move all users from host1 to host2, based on account information in the Directory Server airius.com:
MoveUser -l \
"ldap://airius.com:389/o=Airius.com???(mailhost=host1.domain.com)" \
-D "cn=Directory Manager" -w password -s host1 -x admin -p password \
-d host2 -a admin -v password
To move one user from host1 which uses port 150 to host2, based on account information in the Directory Server airius.com:
MoveUser -l \
"ldap://airius.com:389/o=Airius.com???(uid=userid)" \
-D "cn=Directory Manager" -w password -s host1:150 -x admin \
-p password -d host2 -a admin -v password
To move a group of users whose uid starts with letter `s' from host1 to host2, based on account information in the Directory Server server1.airius.com:
MoveUser -l \
"ldap://server1.airius.com:389/o=Airius.com???(uid=s*)" \
-D "cn=Directory Manager" -w password -s host1 -x admin \
-p password -d host2 -a admin -v password
To move a user's mailboxes from host1 to host2 when the user ID of admin is specified in the command line:
MoveUser -u uid \
-s host1 -x admin -p password \
-d host2 -a admin -v password
To move a user named aldonza from host1 to a new user ID named dulcinea on host2:
MoveUser -u aldonza -U dulcinea \
-s host1 -x admin -p password \
-d host2 -a admin -v password
NscpMsg
The NscpMsg utility starts, stops, and refreshes the Messaging Server services. This utility is available in Unix environments only.
NscpMsg Syntax/NscpMsg start [ imap | pop | http | smtp | store | snmpagt ]
/NscpMsg stop [ imap | pop | http | smtp | store | snmpagt ]
/NscpMsg refresh [ imap | pop | http | smtp | store | snmpagt ]
/NscpMsg list [ imap | pop | http | smtp | store | snmpagt ]
Requirements: Must be run as root locally on the Messaging server.
Location: /etc
server-root/bin/msg/admin/bin
The NscpMsg utility sets the CONFIGROOT and LD_LIBRARY_PATH environment variables for the commands it runs.
NscpMsg is similar to the /etc/NscpMail utility supplied with Messaging Server 3.x.
Table A.12 NscpMsg options
Option
| Description
|
refresh
|
Refresh messaging server processes.
|
start
|
Starts all messaging server processes (stored, smtpd, popd, imapd, httpd), or optionally, one specified service.
|
stop
|
Stops all messaging server processes (stored, smtpd, popd, imapd, httpd), or optionally, one specified service.
|
list
|
Lists all messaging server processes.
|
processq
The processq utility immediately delivers messages in the deferred queue.
processq Syntaxprocessq [[-R]hostname]
Requirements: Must be locally run on the server.
Location on Unix: /usr/lib
Location on NT: server-root/bin/msg/admin/bin
The deferred queue is automatically processed at regular intervals, so you normally never need to deliver the queue manually with the processq utility. You can also manage the queue by using the Netscape Console. For more information, see Message Queue Concepts.
processq Examples
To deliver all messages in the deferred queue:
/usr/lib/processq
To deliver all queued mail addressed to math.marsu.edu:
/usr/lib/processq -Rmath.marsu.edu
To deliver all queued mail addressed to all hosts in the domain marsu.edu:
/usr/lib/processq `*.marsu.edu'
qconvert
The qconvert utility converts the Netscape Messaging Server 3.x message queue to the Netscape Messaging Server 4.x format.
Examples of Ways to Use qconvertqconvert [-s sourceq -d targetq] [-l] [-r] [-h] [-f configdbfile]
Requirements: Must be run locally on the Messaging server.
Location: server-root/bin/msg/admin/bin
If you do not specify the location of the 3.x message queue or the 4.x message queue, the qconvert utility reads the 3.x and 4.x configuration files to locate the message queue directories. Consequently, if you do not specify the message queue locations, the following configuration information must be available to the qconvert utility.
For Messaging Server 3.x, configuration information is determined as shown in Table A.15:
For Messaging Server 4.x, configuration information is determined as shown in Table A.16 :
The qconvert utility reads the 3.x directories in the following order:
sourceq/control, sourceq/deferred, sourceq/messages. These directories are subdirectories of the post office directory that was specified at installation time.
The qconvert utility reads and converts the 3.x directories as follows:
The utility reads the 3.x control files and rewrites them into the 4.x envelope log file located in targetq/control/env-date-1.
The utility reads the 3.x deferred directory and creates an envelope file for every subdirectory in the 4.x deferred directory.
The utility merges the 3.x message header file (-Header) and message body file (-Body) into one 4.x file located in targetq/control/msgname.
The utility automatically converts 3.x access rights to 4.x access rights so that users have access to the appropriate files.
quota
The quota utility reports mailbox quota usage. This utility generates a report listing quotas, giving their limits and usage.
quota Syntaxquota [user/user-id...]
Requirements: Must be run locally on the Messaging server; the stored utility must also be running.
Location: server-root/bin/msg/admin/bin
Netscape Messaging Server supports quotas at the root (inbox) level. Quotas on subdirectories are not supported.
readership
The readership utility reports on how many users other than the mailbox owner have read messages in a shared IMAP folder.
An owner of a IMAP folder may grant permission for others to read mail in the folder. A folder that others are allowed to access is called a shared folder. Administrators can use the readership utility to see how many users other than the owner are accessing a shared folder.
This utility scans all mailboxes.
readership Syntaxreadership [-d days] [-p months]
Requirements: Must be run locally on the Messaging server; the stored utility must also be running.
Location: server-root/bin/msg/admin/bin
This utility produces one line of output per shared folder, reporting the number of readers followed by a space and the name of the mailbox.
Each reader is a distinct authentication identity that has selected the shared folder within the past specified number of 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 folder's owner.
reconstruct
The reconstruct utility rebuilds one or more mailboxes, or the master mailbox file, and repairs any inconsistencies. You can use this utility to recover from almost any form of data corruption in the mail store. Note that low-level database repair, such as completing transactions and rolling back incomplete transactions is performed with stored -d.
reconstruct Syntaxreconstruct [-p partition] [-r [mailbox [mailbox...]] | [-m] [-q]
[-o [-d filename]]
Requirements: Must be run locally on the Messaging server; the stored utility must also be running.
Location: server-root/bin/msg/admin/bin
Note: Netscape recommends that you shut down your server before running the reconstruct utility--unless advised otherwise by Netscape Technical Support.
The mailbox argument indicates the mailbox to be repaired. You can specify one or more mailboxes. Mailboxes are specified with names in the format user/userid/sub-mailbox. Where userid is the user that owns the mailbox. For example, the inbox of the user dulcinea is entered as: user/dulcinea/INBOX.
Examples of Ways to Use reconstruct
Rebuilding Mailboxes
To rebuild mailboxes, use the -r option. You should use this option when:
For example, to rebuild the spool area for the mailboxes belonging to the user Daphne, use the following command:
reconstruct -r user/daphne
To rebuild the spool area for all mailboxes listed in the mailbox database:
reconstruct -r
You must use this option with caution, however, because rebuilding the spool area for all mailboxes listed in the mailbox database can take a very long time for large message stores. (See reconstruct Performance.) A better method for failure recovery might be to use multiple disks for the store. If one disk goes down, the entire store does not. If a disk becomes corrupt, you need only rebuild a portion of the store by using the -p option as follows:
reconstruct -r -p subpartition
To rebuild mailboxes listed in the command line argument only if they are in the primary partition:
reconstruct -p primary mbox1 mbox2 mbox3
If you do need to rebuild all mailboxes in the primary partition:
reconstruct -r -p primary
Checking and Repairing Mailboxes
To perform a high-level consistency check and repair of the mailboxes database:
reconstruct -m
You should use the -m option when:
Removing Orphaned Accounts
To search for orphaned accounts (orphaned accounts are mailboxes that do not have corresponding entries in LDAP):
reconstruct -o
reconstruct: Start checking for orphaned mailboxes
mboxutil -d user/test/annie/INBOX
mboxutil -d user/test/oliver/INBOX
reconstruct: Found 2 orphaned mailbox(es)
reconstruct: Done checking for orphaned mailboxes
To create a file listing orphaned mailboxes that can be turned into a script file that deletes the orphaned mailboxes, where the file is to be named orphans.cmd:
reconstruct -o -d orphans.cmd
reconstruct: Start checking for orphaned mailboxes
reconstruct: Found 2 orphaned mailbox(es)
reconstruct: Done checking for orphaned mailboxes
reconstruct Performance
The time it takes reconstruct to perform an operation depends on a number of factors including:
In one example with approximately 2400 users, a message store of 85GB, and concurrent POP, IMAP, or SMTP activity on the server:
Note: A reconstruct operation may take significantly less time if the server is not performing ongoing POP, IMAP, HTTP, or SMTP activity.
stored
The stored utility performs the following functions:
The stored utility automatically performs cleanup and expiration operations once a day at midnight. You can choose to run additional cleanup and expiration operations.
How Messages are Deleted
Messaging Server messages are erased in three stages:
Delete. A client marks the message to be deleted. This is referred to as deleting a message. At this point, the client can restore the message by removing the "deleted" marking.
Expunge. A client, or the expiration policies you have specified, expunges messages that have been marked deleted from the mailbox. Once messages are expunged, the client can no longer restore them, but they are still stored on disk. (A second client with an existing connection to the same mailbox may still be able to fetch the messages.)
Cleanup. The stored utility erases messages from the disk that have been expunged for at least one hour.
stored Syntax
To run stored from the command line to perform a specific operation:
stored [-1] [-c] [-n] [-v [-v]]
To run stored as daemon:
stored [-d] [-v [-v]]
Requirements: Must be run locally on the Messaging server.
Location: server-root/bin/msg/admin/bin
Examples of Ways to Use stored
To test expiration policies:
stored -n
To perform a single aging and cleanup pass:
stored -l -v
If you want to change the time of the automatic cleanup and expiration operations, use the configutil utility as follows:
configutil -o store.expirestart -v 21
Occasionally, you might need to restart the stored utility; for example, if the mailbox list database becomes corrupted. To restart stored on Unix, use the following commands at the command line:
/etc/NscpMsg stop store
/etc/NscpMsg start store
To restart stored on Windows NT, use the Service Control Manager.
If any server daemon crashes, you must stop all daemons and restart all daemons including stored.
upgrade
The upgrade utility transfers mailboxes stored in 3.x format on a 3.x server to Netscape Messaging Server 4.x format mailboxes. (For complete information about upgrading your server, see the Messaging Server Installation Guide.)
The upgrade utility is similar to the migrate utility provided by 3.x. The 3.x utility migrated both users and their mailboxes. The Messaging Server upgrade utility only transfers mailboxes since the way users are stored has not changed from 3.x to 4.x.
The 4.x upgrade utility assumes that both Messaging Server 3.x and Messaging Server 4.x reside on the same machine. The utility transfers the 3.x mailboxes on a machine to 4.x format mailboxes on the same machine. Once upgrade has been run, you cannot start up the 3.x processes.
The 4.x upgrade process occurs in two steps: (1) The folders are upgraded. (2) The messages are upgraded. You must update the folders (by using the -s option) before you update the messages (by using the -m or -u options). The message upgrade is a multi-threaded process. You can specify the number of threads by using the -t option.
The 4.x upgrade utility first searches the LDAP server to find all the user mailboxes in that machine (users are considered to belong the 3.x server if their mailhost attribute is one of the MessageHostNames in that 3.x server). It then creates a one-to-one mailbox mapping in the 4.x mailbox database. These mailboxes are marked as "TRANSITION".
Based on the options you specify, upgrade can transfer all 3.x mailboxes immediately. In NT environments, the upgrade utility retrieves the 3.x information through the registry. In Unix environments, the upgrade utility retrieves the 3.x information through a predefined configuration file. The upgrade does not change the 3.x directory structure, so 4.x must be put in a different directory.
If you have 3.x mailboxes located in non-default mailbox paths, the upgrade utility tries to create a 4.x mailbox directory in that mailbox path, and uses a number (such as 001) to automatically assign the 4.x partition name. In 4.x, the partition name is a logical name of a physical directory where user mailboxes can be physically created.
You can find the detailed mailbox-mapping information in the upgrade.conf file in the default 3.x mailbox directory.
If you have servers on multiple machines, you must run upgrade on each different machine.
Your mailboxes will require more disk space after the upgrade to 4.x as follows:
If you want to save disk space, you can use the -r option to remove the messages after the upgrade.
upgrade Syntaxupgrade [-s] [-m] [-u userlist] [-i] [-r] [-h] [-f configdbfile] [-F]
[-t number]
Requirements: Must be run locally on the Messaging server; the stored utility must also be running.
Location: server-root/bin/msg/admin/bin