# man > dotlock(1)

---
type: CommandReference
command: dotlock.mailutils
mode: man
section: "1"
source: man-pages
---

## Quick Reference
- `dotlock.mailutils /var/mail/user` — lock a mail spool file
- `dotlock.mailutils -u /var/mail/user` — unlock the file
- `dotlock.mailutils -f /var/mail/user` — forcibly break an existing lock (older than certain time)
- `dotlock.mailutils -r -t 5 /var/mail/user` — retry lock with 5-second delay between attempts
- `dotlock.mailutils -d -r /var/mail/user` — debug locking with retries, printing failure reasons
- `dotlock.mailutils --config-lint` — check configuration file syntax
- `dotlock.mailutils -V` — show program version
- `dotlock.mailutils --help` — display help summary

## Name
lock mail spool files.

## Synopsis
`dotlock.mailutils` [_OPTION_...] _FILE_

## Options
### Locking options
- `-d, --debug` — print details of failure reasons to stderr
- `-f, --force` — forcibly break an existing lock older than a certain time
- `-p, --pid-check` — check if the PID of the lock owner is still active
- `-r, --retry` — retry the lock a few times
- `-t, --delay` — delay between two successive locking attempts (in seconds)
- `-u, --unlock` — unlock

### Global debugging settings
- `--debug-level=`_LEVEL_ — set Mailutils debugging level
- `--debug-line-info` — show source info with debugging messages

### Configuration handling
- `--config-file=`_FILE_ — load this configuration file; implies `--no-config`
- `--config-lint` — check configuration file syntax and exit
- `--config-verbose` — verbosely log parsing of the configuration files
- `--no-config` — do not load site and user configuration files
- `--no-site-config` — do not load site-wide configuration file
- `--no-user-config` — do not load user configuration file
- `--set=`_PARAM=VALUE_ — set configuration parameter

### Informational options
- `--config-help` — show configuration file summary
- `--show-config-options` — show compilation options
- `-?, --help` — give this help list
- `--usage` — give a short usage message
- `-V, --version` — print program version

## Examples
shell
# Lock a mailbox file
dotlock.mailutils /var/mail/alice

# Unlock after processing
dotlock.mailutils -u /var/mail/alice

# Forcefully break a stale lock and retry
dotlock.mailutils -f -r /var/mail/alice

# Retry locking with a 2-second delay, verbose failures
dotlock.mailutils -d -r -t 2 /var/mail/alice
## See Also
- [GNU Mailutils Manual](https://www.gnu.org/software/mailutils/manual/index.html)
- `info mailutils` (if the `mailutils-doc` package is installed)

## Exit Codes
- `0` — success
- `3` — locking failed because the file is already locked
- `1` — other error