enigma-bbs
enigma-bbs copied to clipboard
Expand oputil mb functionality to purge/pack/reset mail areas
Is your feature request related to a problem? Please describe.
Currently, we need to manipulate the message base using sqlite3
.
Describe the solution you'd like
It would be great if the ./oputil.js mb
command could be used to do the following:
- purge messages older than X days
- purge messages when the count in the area reaches Y
- reset (empty) an area completely (e.g. to resync it from the hub)
The first two options could be achieved by adding parameters in the area properties in the config.hjson
file:
messageConferences: {
tqwnet: {
name: tqwNet
desc: tqwNet Areas
sort: 2
default: true
areas: {
tqw_ads: {
name: "[TQW] BBS Adverts"
desc: "[TQW] BBS Adverts"
max_age: 365
max_count: 2000
}
}
}
In this example, max_age: 365
would cause messages older than 365 days in the area tqw_afs
to be purged. Question is, would the date of import be considered or the send date of the message? (haven't looked in the database yet, I'd vote for the latter if it would be a choice).
The parameter max_count: 2000
would obviously cause a purge of messages older than the last 2000 messages. Again, not sure about which date to consider.
A separate reset
option would be useful to reset (empty) an area if so desired. Maybe a wildcard could be implemented, although that might be a risky option. Likewise, maybe a reset-conference option could be implemented, not sure how often you'd use that though.
The first two would be very nice to have IMHO, because we could have a maintenance oputil
job run every day/week to maintain the message base.
Describe alternatives you've considered
Hacking away with sqlite3
, which is kinda... error prone? ;)
Additional context Nothing further, I think :)