Re: delete from hold queue

2021-10-28 Thread Viktor Dukhovni
On Fri, Oct 29, 2021 at 05:26:53AM +0100, Dominic Raferd wrote: > Always great to learn from a master! I had not used postqueue -j, json > or jq until yesterday... Here's a more convincing demo, mock partial "postqueue -j" output: $ jq -cn ' now as $t |

Re: delete from hold queue

2021-10-28 Thread Dominic Raferd
On 29/10/2021 05:24, Viktor Dukhovni wrote: On Thu, Oct 28, 2021 at 10:14:15PM -0400, Viktor Dukhovni wrote: postqueue -j | jq -nr --argjson $days ' Correction, that first line should be: postqueue -j | jq -nr --argjson days $days ' Setting the "jq" variabe "$days" to the shell

Re: delete from hold queue

2021-10-28 Thread Viktor Dukhovni
On Thu, Oct 28, 2021 at 10:14:15PM -0400, Viktor Dukhovni wrote: > postqueue -j | jq -nr --argjson $days ' Correction, that first line should be: postqueue -j | jq -nr --argjson days $days ' Setting the "jq" variabe "$days" to the shell variable "$days". The rest is unchanged: >

Re: delete from hold queue

2021-10-28 Thread Peter Ajamian
On 29/10/21 2:53 pm, Peter wrote: 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

Re: delete from hold queue

2021-10-28 Thread Viktor Dukhovni
On Thu, Oct 28, 2021 at 12:01:35PM +0100, Dominic Raferd wrote: > # obtain QIDs, if any > QIDS=( $("$POSTQUEUE" -j|grep -F '"queue_name": "hold"'|"$JQ" '.arrival_time, > .queue_id'|sed 'N;s/\n//;s/"/,/g'|awk -F, -v BEFORE="$BEFORE" '{if > ($1 echo -n "${#QIDS[*]} mail(s) earlier than $1 found

Re: delete from hold queue

2021-10-28 Thread Peter
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

Re: delete from hold queue

2021-10-28 Thread richard lucassen
On Thu, 28 Oct 2021 12:01:35 +0100 Dominic Raferd wrote: > I attach a script that can do it. Thnx, but I did not ask to write one, I'm just too lazy to reinvent the wheel :) I will put it to the test anyway :) -- richard lucassen http://contact.xaq.nl/

Re: delete from hold queue

2021-10-28 Thread Dominic Raferd
I attach a script that can do it. On 28/10/2021 11:56, richard lucassen wrote: On Thu, 28 Oct 2021 12:26:31 +0200 Matus UHLAR - fantomas wrote: Why do you have _any_ messages in the hold queue? Don't do that! kind of quarantine I guess. Yep. Most of these messages are bank phishing mails

Re: delete from hold queue

2021-10-28 Thread richard lucassen
On Thu, 28 Oct 2021 12:26:31 +0200 Matus UHLAR - fantomas wrote: > >Why do you have _any_ messages in the hold queue? Don't do that! > > kind of quarantine I guess. Yep. Most of these messages are bank phishing mails BTW, I delete the hold queue once a day. But never mind, was just wondering

Re: delete from hold queue

2021-10-28 Thread Matus UHLAR - fantomas
On Thu, Oct 28, 2021 at 10:39:52AM +0200, richard lucassen wrote: Anyone here who wrote a shell script that deletes messages older than X days from the hold queue? On 28.10.21 11:10, Bastian Blank wrote: Why do you have _any_ messages in the hold queue? Don't do that! kind of quarantine I

Re: delete from hold queue

2021-10-28 Thread Bastian Blank
On Thu, Oct 28, 2021 at 10:39:52AM +0200, richard lucassen wrote: > Anyone here who wrote a shell script that deletes messages older than X > days from the hold queue? Why do you have _any_ messages in the hold queue? Don't do that! Bastian -- You're too beautiful to ignore. Too much woman.

delete from hold queue

2021-10-28 Thread richard lucassen
Hello list, Anyone here who wrote a shell script that deletes messages older than X days from the hold queue? R. -- richard lucassen http://contact.xaq.nl/