Message Pruning Command Line
Print
##################################
MDaemon Technologies LTD.
AccountPrune
Version 2.1.0.0
www.altn.com
Tech-Support:
www.altn.com/support/
Copyright (C) 2007-2018 MDaemon Technologies, Ltd.
##################################
This program will remove inactive users and old mail from MDaemon. It also provides
functionalities for specific pruning of
deleted IMAP messages, old messages in user's IMAP folder, old messages in IMAP
public folder, and archiving of messages.
These are the available command line options:
/A --> Auto start
/L --> Logging mode
/D --> Age of file
/P --> Specific folder that will be pruned/archived
/U --> Prune specific user's IMAP folder
/S --> Recursive pruning of IMAP folder
/M --> Delete message
/N --> Move message
/F --> Prune public folder
/Z --> Archive message path(if "/N" option not used) or move message path(if "/N"
option used)
/R --> Delete source messages after archiving
/C --> Include dates in archived file name
/E --> Exclude folder from archiving if using subfolder(/S) archiving option
Running the program without a command line option will open the program and allow
you to run it manually.
Command Options:
(1) AUTO START:
Using the /A command line option will have the program run and exit
automatically. This option will automatically
remove inactive and disabled users, old mail, account auto responder data and
clear mail check data. The pruning
will be executed according to the pruning settings enabled on MDaemon.
The following is an example of the line option:
Accountprune.exe /A
(2) LOG MODE:
Using the /L command line option will run the program in log only mode. No
actual accounts or mails will be removed
or moved. The Log mode will not work with the Auto Start(\A) mode. It will
work with the Delete(/M) and Move(/N) options.
The following is an example of the line option:
Accountprune.exe /m /d=2 /p="all" /L
The above command line will only log(not remove) messages that are at least 2
days old in all user's Inbox and root IMAP folders.
This is an example of the folders(Inbox and root IMAP folders) that will be
pruned for the above command line:
C:\MDaemon\Users\altn.test.com\user1
C:\MDaemon\Users\altn.test.com\user1\Deleted Items.IMAP
C:\MDaemon\Users\altn.test.com\user1\Sent Items.IMAP
C:\MDaemon\Users\altn.test.com\user1\TestMailFolder.IMAP
Accountprune.exe /n /d=2 /p="all" /z="c:\Archive\Logs" /L
The above command line will only log(not move) messages that are at least 2 days
old in all user's Inbox and root IMAP folders.
(3) AGE OF FILE:
Using the /D command line option specifies the age of the file. This value
specifies the number of days that any
given message may reside in the account's mailbox before it will be deleted.
The following is an example of the line option:
Accountprune.exe /m /d=5 /p="all"
The above command line will remove messages in all user's Inbox and root IMAP
folders that are at least 5 days old.
(4) SPECIFIED FOLDER:
Using the /P command line option specifies the folder that you want to delete or
archive. To prune all folders use
/p="all". To prune specific IMAP folders, use the folder name such as
/p="Spam.IMAP".
(a) The following is an example of the line option:
Accountprune.exe /m /d=2 /p="all"
The above command line will prune every user's Inbox and root IMAP folders
that are at least 2 days old.
(b) The following is an example of the line option:
Accountprune.exe /m /d=2 /p="Spam.IMAP"
The above command line will prune every user's root Spam.IMAP folder that is
at least 2 days old.
This is an example of the Spam.IMAP folder path for the above command line:
C:\MDaemon\Users\altn.test.com\user1\Spam.IMAP
C:\MDaemon\Users\altn.test.com\user2\Spam.IMAP
(c) The following is an example of the line option:
Accountprune.exe /m /d=2 /p="INBOX.IMAP"
The above command line will prune every user's root Inbox folder that is at
least 2 days old. You
cannot use the recursive option(/s) with the above command. Using the
recursive option(/s) is not
allowed when the specified folder is the Inbox(/p="INBOX.IMAP"). This is an
example of the INBOX.IMAP
folder path for the above command line:
C:\MDaemon\Users\altn.test.com\user1
C:\MDaemon\Users\altn.test.com\user2
C:\MDaemon\Users\altn.test.com\user3
(d) The following is an example of the line option:
Accountprune.exe /m /d=30 /p="One.IMAP\Two.IMAP\Three.IMAP"
The above command line will prune every user's messages in the Three.IMAP
subfolder that is at
least 30 days old. This is an example of the Three.IMAP folder path for the above
command line:
C:\MDaemon\Users\altn.test.com\user1\One.IMAP\Two.IMAP\Three.IMAP
(5) SPECIFIED USER:
Use the /U command line option when you want to prune a particular user's IMAP
folder.
(a) The following is an example of the line option:
Accountprune.exe /m /d=2 /p="Sent Items.IMAP" /u="sue@altn.test.com"
The above command line will prune Sue's messages in the "Sent Items.IMAP"
folder that is at least 2 days old.
This is an example of the "Sent Items.IMAP" folder path for the above
command line:
C:\MDaemon\Users\altn.test.com\sue\Sent Items.IMAP
(b) The following is an example of the line option:
Accountprune.exe /m /d=2 /p="INBOX.IMAP" /u="sue@altn.test.com"
The above command line will prune Sue's messages in the Inbox folder that is
at least 2 days old.
(c) The following is an example of the line option:
Accountprune.exe /m /d=20 /p="Sent Items.IMAP\SubSent.IMAP" /u="sue@altn.test.com"
The above command line will prune Sue's messages in the SubSent.IMAP subfolder
that is at least
20 days old. This is an example of the SubSent.IMAP folder path for the above
command line:
C:\MDaemon\Users\altn.test.com\sue\Sent Items.IMAP\SubSent.IMAP
(6) RECURSIVE PRUNING:
Using the /S option specifies recursive pruning. That means that the root
folders and its subfolders will be pruned.
The following is an example of the line option:
Accountprune.exe /m /d=2 /p="Spam.IMAP" /S
The above command line will prune all user's Spam.IMAP folder and its
subfolders(recursive) that are at least 2 days old.
(7) DELETE MESSAGE:
Using the /M command line option will delete messages from user's IMAP folders
and public IMAP folders.
(8) MOVE MESSAGE:
Using the /N command line option will move messages from the user's IMAP folders
and the public IMAP folders. If the
destination folder(/z) does not exist, it will be created. If the pruned message
already exists in the
destination folder, the move will fail or will not occur. You CAN NOT use both the
delete option("/m") and
the move option("\n") together. It's either one or the other option.
(a) The following is an example of the line option:
Accountprune.exe /n /d=2 /p="all" /z="c:\backup\archive"
The above command line will move messages from every user's Inbox and root IMAP
folders that are at least 2 days old
to the destination folder, "c:\backup\archive".
(b) The following is an example of the line option:
Accountprune.exe /n /d=2 /p="all" /z="c:\backup\archive" /s
The above command line will move messages from every user's Inbox and root IMAP
folders and its subfolders(recursive)
that are at least 2 days old to the destination folder, "c:\backup\archive".
(c) The following is an example of the line option:
Accountprune.exe /n /d=2 /p="Spam.IMAP" /z="c:\backup\archive"
The above command line will move messages from every user's root Spam.IMAP folder
that are at least 2 days old
to the destination folder, "c:\backup\archive".
(d) The following is an example of the line option:
Accountprune.exe /n /d=2 /p="Deleted Items.IMAP" /u="frank@altn.test.com"
/z="c:\backup\archive"
The above command line will move messages from Frank's "Deleted Items.IMAP" folder
that are at least 2 days old
to the destination folder, "c:\backup\archive".
(e) The following is an example of the line option:
Accountprune.exe /n /d=2 /p="all" /z="c:\backup\archive" /f
The above command line will move all messages in the root public folders that
are at least 2 days old
to the destination folder, "c:\backup\archive". Add the recursive("/s") option
to also move subfolders.
(f) The following is an example of the line option:
Accountprune.exe /n /d=2 /p="Spam.IMAP" /z="c:\backup\archive" /f
The above command line will move all messages in the Spam.IMAP root public folder
that are at least 2 days old
to the destination folder, "c:\backup\archive".
(g) The following is an example of the line option:
Accountprune.exe /n /d=2 /p="Spam.IMAP\SpamFilter.IMAP" /z="c:\backup\archive" /f
The above command line will move all messages in the SpamFilter.IMAP public
subfolder that are at
least 2 days old to the destination folder, "c:\backup\archive".
(9) PRUNE PUBLIC FOLDER:
Using the /F command line option will prune public folders.
(a) The following is an example of the line option:
Accountprune.exe /m /d=2 /p="all" /f
The above command line will prune all root public folders that are at least
2 days old.
(b) The following is an example of the line option:
Accountprune.exe /m /d=10 /p="Spam.IMAP" /f
The above command line will remove messages in the Spam.IMAP root public
folder that are at least 10 days old.
This is an example of the Spam.IMAP folder path:
C:\MDaemon\Public folders\Spam.IMAP
(c) The following is an example of the line option:
Accountprune.exe /m /d=10 /p="Spam.IMAP\SpamFilter.IMAP" /f
The above command line will remove messages in the SpamFilter.IMAP public
subfolder that are at least 10 days old.
This is an example of the SpamFilter.IMAP folder path:
C:\MDaemon\Public Folders\Spam.IMAP\SpamFilter.IMAP
(d) The following is an example of the line option:
Accountprune.exe /m /d=25 /p="One.IMAP\Two.IMAP\Three.IMAP\Four.IMAP" /f
The above command line will remove messages in the Four.IMAP public subfolder that
are at least 25 days old.
This is an example of the Four.IMAP folder path:
C:\MDaemon\Public Folders\One.IMAP\Two.IMAP\Three.IMAP\Four.IMAP
(e) The following is an example of the line option:
Accountprune.exe /m /d=30 /p="One.IMAP\Two.IMAP\Three.IMAP" /f /l
The above command line will only log messages that are at least 30 days old
in the "Three.IMAP" public subfolder.
(10)ARCHIVE MESSAGE:
Using the /Z command line option will archive messages. Use the /Z switch to
specify the name of the archived file.
Use the /R switch to delete the source messages after archiving. Use the /E
switch to exclude folder from subfolder archiving.
This option only works when you are using the /S switch to archive subfolders.
Use the /C switch to include the date to the
archived file name. If you are also using the move option("/n") with the "z"
option, then the messages will not be archived,
but rather, moved to the destination folder specified by "/z". If the the "/z"
option occurs without the "/n" option, then
archiving will take place. The "/p", "/d", and "/z" switches are required for
archiving messages.
To add the date to the archived file name, these formats are available:
/c="mdy" [month-day-year] --> MyBackupBeta-01-09-2004.zip
/c="dmy" [day-month-year] --> MyBackupBeta-09-01-2004.zip
/c="ymd" [year-month-day] --> MyBackupBeat-2004-01-09.zip
(a) The following is an example of the line option:
Accountprune.exe /p="C:\temp\MDaemon\Public Folders\md-beta.IMAP" /d=30
/z="C:\MyBackupDir\MyBackupBeta.zip"
The above command line will archive messages from the md-beta.IMAP public folder
that are at least 30 days old and name the
archived file "MyBackupBeta.zip" and place it in the "C:\MyBackupDir" directory.
(b) The following is an example of the line option:
Accountprune.exe /p="C:\MDaemon\Public folders\md-beta.IMAP" /d=30
/z="C:\MyBackupDir\MyBackupBeta.zip" /r
The above command line will archive messages from the "md-beta.IMAP" folder and
delete the source file after archiving.
(c) The following is an example of the line option:
Accountprune.exe /p="C:\MDaemon\Public Folders\md-beta.IMAP" /d=30
/z="C:\MyBackupDir\MyBackupBeta.zip" /c="mdy"
The above command line will archive messages from the "md-beta.IMAP" folder and
name the archived file MyBackupBeta-01-09-2004.zip.
(d) The following is an example of the line option:
Accountprune.exe /p="C:\MDaemon\Public Folders" /d=1
/z="C:\MyBackupDir\MyBackupPublicFolders.zip" /c="mdy" /s
The above command line will archive the messages in the Public Folders and its
subfolders that are at least 1 days old.
(e) The following is an example of the line option:
Accountprune.exe /p="C:\MDaemon\Public Folders" /d=1
/z="C:\MyBackupDir\MyBackupPublicFolders.zip" /e="Calendar.IMAP\*.*" /s
The above command line will archive the messages in the Public Folders and its
subfolders, with the exception of the Calendar.IMAP
folder, that are at least 1 days old. The "*.*" specifies all message type. You
may specify messages with certain extension. For
example, "*.log", "*.msg", "*.old", and etc. For example:
Accountprune.exe /p="C:\MDaemon\Public Folders" /d=1
/z="C:\MyBackupDir\MyBackupPublicFolders.zip" /e="Calendar.IMAP\*.log" /s
Accountprune.exe /p="C:\MDaemon\Public Folders" /d=1
/z="C:\MyBackupDir\MyBackupPublicFolders.zip" /e="Calendar.IMAP\*.msg" /s
Accountprune.exe /p="C:\MDaemon\Public Folders" /d=1
/z="C:\MyBackupDir\MyBackupPublicFolders.zip" /e="Calendar.IMAP\*.old" /s
The "/e" option only works when you are using the "/s" option for archiving
subfolders. You need to specify the message type to
exclude from archiving. If you want it to exclude all message type, then
specify "*.*" after the folder name.
The following setting may be set in the "HIWATER.MRK" file of an IMAP folder to skip
pruning for specified IMAP folder(not applicable to archiving):
[Settings]
SkipAutoPrune=Yes (default=No)
The following setting may be set in the "Domains.dat" file to skip pruning of
inactive account if the account is a forwarding mail account:
[primary.domain.com]
SkipForwardAccount=Yes (default = No)
The following setting may be set in the "Domains.dat" file to prune disabled account
for Auto Start mode("/A"). It requires adding the setting
for each domain:
[primary.domain.com]
RemoveDisabledAccount=Yes (default = No)
Was this answer helpful?