No 'easy button' purge for things like forum postings, etc. :|
One would have to locate all DB tables related, inspect for dates, and relationships to 'importance' ... forums could be 'graded'. Lot's of DB work and one might 'purge' something that needed to be retained.
Would do this, however, in config.php add the following line:
$CFG->noemailever = true;
Something else to think about doing ... if you have SMTP setup and working to a mail server that relays, jot down the config settings. Then remove the settings ... basically telling Moodle to use PHPMailer.
If linux, install postfix ... PHPmailer will see and use postfix for sending the mail. Now the tricky part ... if the nomailever isn't set and cron job hits something that distributes mail ...
In one terminal window (call that session 'Killer') with prepared postfix scripts/commands to purge mail as messages are created and sent - or attempts to send.
The other terminal window actually running the cron via command line in moodlecode/admin/cli/.
Had to do something like the above (minus nomailever setting) for a site that had 10000 users forced subscribed to a forum and newbie Moodle Admin posted a message - then called to say there was a problem.
The 'Killer' session with many command repeats to purge messages before they were sent ... some had been sent and now bounces were coming back or mail deferred ... up arrow, enter ... when that finished, up arrow, enter, etc.. Sat there for about 15 minutes ... very boring ... server extremely slow ... but .... mission accomplished - eventually.
'spirit of sharing', Ken