Sun Java System Messaging Server 6 2005Q4 Administration Reference


The imsimport utility migrates UNIX /var/mail format folders into a Sun Java System Messaging Server message store.

The imsimport utility extracts the messages stored in /var/mail mailboxes and appends them to the corresponding users’ mailbox in the Sun Java System Messaging Server message store. Files in the directory that are not in the standard UNIX mailbox format are skipped. If the corresponding users do not exist in the message store, imsimport creates them. When the user quota is exceeded, imsimport bypasses the message store quota enforcement, so the user does not receive an “over quota” message.

The imsimport utility can be run while Messaging Server is running. If mail delivery is enabled for the mailbox you are importing, old mail can get mixed with new mail, so you might want to hold the delivery of this user during the migration. Mailbox access should not be a problem.

Note –

imsimport does not use the IMAP server. However, the stored utility must be running to maintain message store integrity. The LDAP server should be running if imsimport is expected to create new users.

Location: msg_svr_base/sbin/


imsimport -u user -s file [-c y|n] [-d mailbox] [-e encoding]
[-g] [-i] [-n] [-v mode]


The options for this command are:



-c y|n

Provides an answer to the question: “Do you want to continue?” if an error occurs. Specify y for yes, n for no.

-d mailbox

Specifies the destination mailbox where the messages will be stored. 

-e encoding

Specify an encoding option. 


Specifies debugging mode. 


Ignores the content-length field 


Creates a new mailbox with a .date extension if the mailbox exists. The .date extension is in the following form:


The month is specified by mm. The day is specified by dd. The year is specified by yy. For example, 052097 specifies May 20 in the year 1997. The time of day is specified by HHMMSS. For example 110000 specifies 11:00am.

-s file

Specifies the UNIX folder’s file name where the messages are to be imported. The file parameter must be a full path name. This is a required option.

-u user

Specifies the message store id for a user. Note that this is not necessarily the login id of the user. This is a required option. 

-v mode

Specifies verbose mode. The values for mode are 0, 1, and 2. 0 specifies no output. 1 specifies mailbox level output. 2 (default) specifies message level output.


imsimport migrates the specified /var/mail/folder for the specified user to the Sun Java System Messaging Server message store. If the destination folder is not specified, imsimport calls the destination folder by the same name as the source folder. In the following example, the command migrates the default /var/mail INBOX for the user smith, to the INBOX.

imsimport -u smith -s /var/mail/smith -d INBOX

Similarly, if you are trying to move a folder called test from /home/smith/folders/ to the Sun Java System Messaging Server message store, use the following command:

imsimport -u smith -s /home/smith/folders/test -d test

If a destination folder called test already exists in the Sun Java System Messaging Server message store, imsimport appends the messages to the existing folder in the mailbox.