You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asterisk/contrib/scripts
ThatTotallyRealMyth f973619520
safe_asterisk: Add ownership checks for /etc/asterisk/startup.d and its files.
6 months ago
..
sip_to_pjsip
README.messages-expire
agents.php
ast_coredumper ast_coredumper: Increase reliability 2 years ago
ast_grab_core
ast_logescalator
ast_loggrabber
ast_tls_cert ast_tls_cert: Make certificate validity configurable. 6 months ago
astcli
asterisk.ldap-schema
asterisk.ldif
asterisk.logrotate logrotate: Fix duplicate log entries. 3 years ago
astgenkey
astgenkey.8
astversion
autosupport
autosupport.8
clang-scan-build
dahdi_span_config_hook
dbsep.cgi
file.convert.sh
get_ilbc_source.sh
get_mp3_source.sh
get_swagger_ui.sh
import-cdr-csv-mysql.pl
install_prereq Add C++ Standard detection to configure and fix a new C++20 compile issue 1 year ago
live_ast live_ast: Add astcachedir to generated asterisk.conf. 2 years ago
loadtest.tcl
lookup.agi
managerproxy.pl
messages-expire.pl
qview.pl
refcounter.py
reflocks.py
refstats.py
retrieve_extensions_from_mysql.pl
retrieve_extensions_from_sql.pl
safe_asterisk safe_asterisk: Add ownership checks for /etc/asterisk/startup.d and its files. 6 months ago
safe_asterisk.8
safe_asterisk_restart
sipp-sendfax.xml
spandspflow2pcap.log
spandspflow2pcap.py
valgrind_compare
vmail.cgi users.conf: Remove deprecated users.conf integration. 6 months ago
voicemailpwcheck.py

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.