1.\" $OpenBSD: lockspool.1,v 1.9 2007/05/31 19:19:40 jmc Exp $ 2.\" 3.\" Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: May 31 2007 $ 18.Dt LOCKSPOOL 1 19.Os 20.Sh NAME 21.Nm lockspool 22.Nd lock user's system mailbox 23.Sh SYNOPSIS 24.Nm lockspool 25.Op Ar username 26.Sh DESCRIPTION 27.Nm 28is useful for a client mail program to attain proper locking. 29.Nm 30obtains a 31.Pa username.lock 32for the calling user and retains it until stdin is closed or a signal like 33.Dv SIGINT , 34.Dv SIGTERM , 35or 36.Dv SIGHUP 37is received. 38Additionally, the superuser may specify the name of a user in order 39to lock a different mailbox. 40.Pp 41If 42.Nm 43is able to create the lock file, 44.Dq 1 45is written to stdout, otherwise 46.Dq 0 47is written and an error message is written to stderr. 48.Nm 49will try up to 10 times to get the lock (sleeping 50for a short period in between tries). 51.Pp 52The 53.Nm 54utility exits 0 on success, and 1 if an error occurs. 55.Sh FILES 56.Bl -tag -width /var/mail/username.lock -compact 57.It Pa /var/mail/username.lock 58user's mail lock file 59.El 60.Sh SEE ALSO 61.Xr mail 1 , 62.Xr mail.local 8 , 63.Xr sendmail 8 64.Sh HISTORY 65The 66.Nm 67program appeared in 68.Ox 2.4 . 69