# man > dotlock.mailutils(1)

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

## Quick Reference
- `dotlock.mailutils file` — lock the file
- `dotlock.mailutils -u file` — unlock the file
- `dotlock.mailutils -f file` — force break an old lock
- `dotlock.mailutils -r file` — retry locking if the file is locked
- `dotlock.mailutils -d -p file` — lock with PID check and debug output
- `dotlock.mailutils --config-file=my.rc file` — lock using a custom configuration
- `dotlock.mailutils --config-lint` — check configuration file syntax
- `dotlock.mailutils --help` — show help summary

## Name
lock mail spool files

## Synopsis
`dotlock.mailutils` [*OPTION*...] *FILE*

## Options

### Locking Options
- `-d`, `--debug` — print 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

### Debugging
- `--debug-level=`*LEVEL* — set Mailutils debugging level
- `--debug-line-info` — show source info with debugging messages

### Configuration
- `--config-file=`*FILE* — load this configuration file; implies `--no-config`
- `--config-lint` — check configuration file syntax and exit
- `--config-verbose` — verbosely log parsing of 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
- `--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

Lock a mail spool file:
shell
dotlock.mailutils /var/mail/user
Unlock the same file:
shell
dotlock.mailutils -u /var/mail/user
Force break an old lock (e.g., stale lock):
shell
dotlock.mailutils -f /var/mail/user
Retry lock with delay:
shell
dotlock.mailutils -r -t 5 /var/mail/user
Check configuration syntax:
shell
dotlock.mailutils --config-lint
## Exit Codes
- `0` — success
- `3` — locking failed because the file is already locked
- `1` — any other error

## See Also
- [GNU Mailutils](https://www.gnu.org/software/mailutils/)
- [GNU Mailutils Manual](https://www.gnu.org/software/mailutils/manual/)
- `info mailutils` (if the `mailutils-doc` package is installed)