Admin Commit 26f3eab611 This commit was manufactured by cvs2svn to create branch 'v1-0'. %!s(int64=20) %!d(string=hai) anos
..
README.messages-expire 66be370eb6 Trivial fix for README.messages-expire %!s(int64=21) %!d(string=hai) anos
addmailbox ec1651f1a5 Update addmailbox script (bug #404) %!s(int64=21) %!d(string=hai) anos
astgenkey db0c8676cc Update astgenkey to make empty ones too %!s(int64=20) %!d(string=hai) anos
astgenkey.8 63529a85c9 This commit was manufactured by cvs2svn to create branch 'v1-0'. %!s(int64=20) %!d(string=hai) anos
astxs 2e771e3e91 fix a bug in some small changes to astxs utility %!s(int64=20) %!d(string=hai) anos
autosupport 87ad1c0fe2 fix misplaced shebang (bug #4643) %!s(int64=20) %!d(string=hai) anos
autosupport.8 26f3eab611 This commit was manufactured by cvs2svn to create branch 'v1-0'. %!s(int64=20) %!d(string=hai) anos
iax-friends.sql 15ed8535e3 Bug # 1503: Add Peter's fix to include "accountcode" support to MySQL based IAX-Friends %!s(int64=21) %!d(string=hai) anos
messages-expire.pl 87dd2ad0d2 Update messages-expire script %!s(int64=21) %!d(string=hai) anos
postgres_cdr.sql 2087e96b19 Add userfield to schema. Bug #833 %!s(int64=21) %!d(string=hai) anos
qview.pl 87df8b1ad9 Move qview to the right place %!s(int64=21) %!d(string=hai) anos
retrieve_extensions_from_mysql.pl 4be85f5fc9 Add the flags column so that if it's set to '1' then that record is not included in the output extensions file %!s(int64=22) %!d(string=hai) anos
retrieve_extensions_from_sql.pl ffd318c513 Add Peter's SQL complaint script (bug #1482) %!s(int64=21) %!d(string=hai) anos
retrieve_sip_conf_from_mysql.pl 0588fcb85d Add flags column so that we can exclude some records from being published in the output file %!s(int64=22) %!d(string=hai) anos
safe_asterisk 80eea5b4a6 Let safe_asterisk take arguments (bug #2085) %!s(int64=21) %!d(string=hai) anos
safe_asterisk.8 26f3eab611 This commit was manufactured by cvs2svn to create branch 'v1-0'. %!s(int64=20) %!d(string=hai) anos
sip-friends.sql d7340b86ee Improve SIP friends support (should address bugs #1063 & #1052) %!s(int64=21) %!d(string=hai) anos
vmail.cgi aabc37bb1d Support both MySQL and traditional mailboxes in vmail.cgi (bug #2297) %!s(int64=20) %!d(string=hai) anos
vmdb.sql 6b579e32d4 Make primary key context and voicemailbox and make the file easier on %!s(int64=21) %!d(string=hai) anos

README.messages-expire

messages-expire.pl

messages-expire finds messages more than X days old and deletes them.
Because the older messages will be the lower numbers in the folder (msg0000
will be older than msg0005), just deleting msg0000 will not work.
expire-messages then runs a routine that goes into every folder in every
mailbox to reorganize. If the folder contains msg0000, no action is taken.
If the folder does not, the rename routine takes the oldest message and
names it msg0000, the next oldest message and names it msg0001 and so on.

The file deletion is done by the -exec parameter to 'find'. It would be far
more efficient to take the output from 'find' and just reorganize the
directories from which we deleted a file. Something for the future...

Keep in mind that messages are deleted at the beginning of the script you
will have mailbox trouble if you check messages before the script
reorganizes your mailbox.

To use it, make sure the paths are right. Adjust $age (originally set to
31) if necessary.