On Wed, 9 Jun 2021, Felipe Gasper via Exim-users wrote:
> Hello,
>
> Is it possible with Eximâ??s Perl integration to create a reference
> that will last throughout a messageâ??s delivery and then be reaped?
>
> Iâ??d like to explore an flock-based lock for mail delivery that
> would allow an external process to suspend delivery by holding a
> lock on a designated path: if Exim/Perl does flock($fh, LOCK_SH)
> and fails EAGAIN, then Exim will defer acceptance of the message.
>
> When the flock() succeeds, ideally that flock()ed Perl $fh will
> last until delivery is done and then be reaped. Is it safe to
> store that in a Perl global, then call something else at the end
> of the routing that deletes/undefs that global? Or is there some
> cleaner way to give Exim such a reference and have Exim hold onto
> it for me until routing/delivery is over?
I am reminded of the exim_lock utility, though that is an external process.
I'm a bit confused.
Are you trying to stop a second message from being accepted *into the
exim queue* whilst the first is being routed/delivered ?
A message is often accepted and delivered by separate exim processes
(it may sit in the queue until some remote event happens)
so I'm not sure that exim can hold a lock through the whole delivery.
Another way the delivery flow is modified is to move a message
between two queues ...
--
Andrew C. Aitchison Kendal, UK
andrew@???