Deleting Old Messages (immsgexp.exe)

"immsgexp.exe" is a utility that deletes messages older than a specified number of days.

Basic Command Syntax

immsgexp -t startdirectory

-d #of_days_to_save

-m specific_mailbox

-f fully_qualified_path_to_mailbox (cannot be used with -t and -m)

The "startdirectory" will be scanned search only "specific_mailbox" and any message older than "#of_days_to_save" will be deleted.

Option -f gives capability to delete "#of_days_to_save" from a "fully_qualified_path_to_mailbox".

Warning: -t option can not be used with the -f option.

Warning: -m option will be ignored if used with the -f option.

A log of exYYMMDD.log (or exYYMMDD.### if .log already exists) will be created and log which directories/mailboxes were scanned, how many messages were deleted, and the amount of disk space saved (by file and directory).

Examples:

The following command deletes all messages in the "C:\Program Files\Ipswitch\IMail" directory that are more than 60 days old.

immsgexp -t"C:\Program Files\Ipswitch\IMail" -d60

The following command deletes all messages in the "spam" mailbox located in the c:imail directory that are more than 60 days old.

immsgexp -t"C:\Program Files\Ipswitch\IMail" -mspam.mbx -d60

The following command deletes messages in the "sent" mailbox of the User "jdoe" that are more than 90 days old.

immsgexp -d90 -f"C:\Program Files\Ipswitch\IMail\jdoe\sent.mbx"

immsgexp.exe command line options

Command

Function

-t

The directory containing the mailboxes from which messages will be deleted.

-d

The number of days that a message will remain on the server before it is deleted.

-m

The name of the mailbox from which messages will be deleted.

-f

Full path to the specific mailbox.

Warning - Can not be used with the -t option.

Warning - The -m option will be ignored when using this option.