On 28/10/21 9:39 pm, richard lucassen wrote:
Hello list,Anyone here who wrote a shell script that deletes messages older than X days from the hold queue?
It's just a one-liner with postqueue -j and a bit of perl:postqueue -j | perl -MJSON -MData::Dumper -ne 'my $j = decode_json($_); next unless $j->{queue_name} eq "hold" && (time()-$j->{arrival_time}) > 86400; system qw(postsuper -d),$j->{queue_id};'
86400 is the number of seconds in a day, adjust accordingly. Peter