> # Each queue is a file in RFC-822 format with one header: Deadline,
> # which is expressed in time_t format.  The body of the message
> # (normally an RFC-822 message) is fed to sendmail to send it.

Were I to reimplement this on a GNU
system, I'd be tempted to represent
the queue with a directory; mtimes
on the files would encode deadlines.

Set a deadline:
        touch --date '3 days' mXXXXX
        touch --date '29 jan' mXXXXX

Find the earliest deadline:
        ls -t m* | tail -1

List the queue:
        ls -t m* | xargs egrep Subject:

Find overdue messages:
        touch ref
        find . -not -newer ref -and -name "m*"

or perhaps just put dummy Subject
lines into ref, and do both with:
        echo "Subject: ------" `date` "-------" > ref
        ls -t m* ref | xargs egrep -h Subject:

Calculating just how early (or late)
messages are isn't so simple, though.

-Dave


Reply via email to