lockmail

Name

lockmail -- create mail lock files

Synopsis

lockmail [-r] [-t timeout] {lockfile} {program} [argument...]

DESCRIPTION

lockmail is a helper utility for working with mailbox files. Mailbox files must be locked to prevent other applications from modifying the mailbox at the same time. Different system use different locking conventions. lockmail uses two of the most common locking mechanisms in use, which should work reliably on most systems.

lockfile is the pathname to an existing mailbox file. By default, lockmail tries to lock the mailbox every five seconds (if the mailbox is already locked), and will give up after three minutes. After the mailbox is succesfully locked, lockmail runs program as a child process, with any optional arguments. When program terminates, lockmail removes the mailbox lock, and terminates itself.

OPTIONS

-r

If a regular lock fails, try a read-only lock. Use this option to lock mailbox files in a read-only directory.

-t timeout

If the lock attempt fails, try again for up to timeout seconds. The actual timeout is rounded up to the next five second interval (a lock attempt is tried every five seconds).

EXIT STATUS

lockmail terminates with the same exit status as program lockmail terminates with the EX_TEMPFAIL exit status if it was unable to obtain a lock, or if program was killed by a signal.

SEE ALSO

maildrop(1), sendmail(8).