On 19/1/20 1:45, Wietse Venema wrote:
I'm adding a new field to the Postfix queue file that says if a
message was forcibly expired. The field is set with the postsuper
command, using syntax that is similar to other postsuper commands.
The new option behaves like 'delete' except of course that it sets
a flag in a file instead of deleting it.
-e queue_id
Expire one message with the named queue ID in the named mail
queue(s) (default: hold, incoming, active and deferred).
This only marks the message as expired. The message will be
returned to the sender when the queue manager opens it for
delivery (but mail in the hold queue stays in that queue).
Deferred messages are returned with the actual reason for the
delay; other messages are returned with the reason "5.7.0 mes-
sage is administratively expired".
To expire multiple files, specify the -e option multiple times,
or specify a queue_id of - to read queue IDs from standard input
(see the -d option for an example).
As implemented, this does not release a file from 'hold'. It only
sets a flag in a queue file. That is the purist approach. However
I suspect that some people would not want to have to say
To delete one file:
postsuper -e queueid -H queueid
As long as one can specify both commands in the same invocation, I don't
believe it'd be a great deal...
Counter-argument: less "unixy" --- "do just one thing and do it well"
To delete a bunch of files:
postqueue -pj | script | postsuper -e -
postqueue -pj | script | postsuper -H -
Some script's filtering criteria could have marked a message in the
queue as "expired"
...but it'd still be held ---say, for manual inspection/forensic
whathever--- by some other's selection logic
If the intent of expiration is to make messages 'go away' then it
makes sense that '-e' automagically un-holds a message, so that the
queue manager can return it as undeliverable.
Yes, save for the above reasoning. I know I'd use it as described above
--- of course others will do it differently.
Just my .02€
Thanks,
/ J.L.