---
name: "dotlock.courier"
section: "1"
platform: "linux"
package: "courier-mta"
version: "0.37.3-2.5"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/dotlock.courier"
---

# dotlock.courier(1)

create mail lock files

## NAME

dotlock - create mail lock files

## SYNOPSIS

**dotlock** \[ **-f**\]  *lockfile* *program* \[ **arg** *...*\]

## DESCRIPTION

The **dotlock** program creates a lock file that's compatible with **maildrop**, and other mail software, then runs **program**. The lock file is removed when **program** terminates.

Because a mailbox file can only be accessed by one program at a time, a lock file must be used by all programs who need to use the mailbox file. Otherwise, while one program uses a mailbox file, another program can write to it, resulting a corrupted mailbox. **dotlock** creates a dot-lock file by default. The **-f** option create an flock lock instead (the file is opened, and the **flock**() system call creates a lock on the file).

**Note:** You must specify the full name of the lock file, including any ".lock" extension. Therefore, use */var/spool/mail/user.lock* to lock */var/spool/mail/user*. If you omit the .lock extension, you'll end up deleting your mail!

## SEE ALSO

[**maildrop**(1)](/maildrop/1.md), [**sendmail**(8)](/sendmail/8.md).
