EXIM_LOCK(8)
π EXIM_LOCK(8) β bestie edition π
okay so this is the manual for exim_lock, living in the System Manager's Manual section (that's section 8, iykyk). Grab a snack, we're locking mailboxes π
β¨ NAME β¨
exim_lock β Mailbox maintenance π
π¦ SYNOPSIS π¦
exim_lock [options]mailbox-file
πΈ DESCRIPTION πΈ
The exim_lock utility locks a mailbox file using the same algorithm as Exim. If you wanna go deep on locking drama, go read the section "appendfile transport", subsection "Operational details for appending" in the Exim specification β that's where all the lore lives π
So like, why would you even want this? Bestie, exim_lock can be used to prevent any modification of a mailbox by Exim or a user agent while you're off investigating a problem. Forensic queen behavior πβ¨
The utility requires the name of the file as its first argument. Then:
- If the locking is successful, the second argument is run as a command (using C's β
system()β function) π« - If there is no second argument, the value of the
SHELLenvironment variable is used π - If that's unset or empty,
/bin/shis run π
When the command finishes, the mailbox is unlocked and the utility ends. Clean exit, no mess, periodt π
The following options are available:
π OPTIONS π
-fcntlβ Use βfcntl()β locking on the open mailbox π-flockβ Use βflock()β locking on the open mailbox, provided the operating system supports it (check before you vibe, some OSes said no π)-intervalβ This must be followed by a number, which is a number of seconds; it sets the interval to sleep between retries (default 3) β°-lockfileβ Create a lock file before opening the mailbox π-mbxβ Lock the mailbox using MBX rules π¬-qβ Suppress verification output π€«-retriesβ This must be followed by a number; it sets the number of times to try to get the lock (default 10) π-restore_timeβ This option causesexim_lockto restore the modified and read times to the locked file before exiting. This allows you to access a locked mailbox (for example, to take a backup copy) without disturbing the times that the user subsequently sees π°οΈβ¨ (honestly iconic)-timeoutβ This must be followed by a number, which is a number of seconds; it sets a timeout to be used with a blocking βfcntl()β lock. If it is not set (the default), a non-blocking call is used β³-vβ Generate verbose output π£οΈ
π the default behavior (important bestie) π
If none of -fcntl, -flock, -lockfile or -mbx are given, the default is to create a lock file and also use βfcntl()β locking on the mailbox, which is the same as Exim's default. That's the OTP right there π
Permission tea β:
- The use of
-fcntlor-flockrequires that the file be writable βοΈ - The use of
-lockfilerequires that the directory containing the file be writable π
Locking by lock file does not last for ever; Exim assumes that a lock file is expired if it is more than 30 minutes old. So no, that lock file from three hours ago is not still valid, bestie π
The -mbx can be used with either or both of -fcntl or -flock. It assumes -fcntl by default. MBX locking causes a shared lock to be taken out on the open mailbox, and an exclusive lock on the file /tmp/.n.m where n and m are the device number and inode number of the mailbox file. When the locking is released, if an exclusive lock can be obtained for the mailbox, the file in /tmp is deleted π§Ήβ¨
π’ about the output π’
The default output contains verification of the locking that takes place. The -v option causes some additional information to be given. The -q option suppresses all output except error messages π€
π«Ά examples, because we love a demo π«Ά
A command such as
exim_lock /var/spool/mail/spqr
runs an interactive shell while the file is locked π whereas
exim_lock -q /var/spool/mail/spqr <<End
<some commands>
End
runs a specific non-interactive sequence of commands while the file is locked, suppressing all verification output π€« A single command can be run by a command such as
exim_lock -q /var/spool/mail/spqr "cp /var/spool/mail/spqr
/some/where"
Note that if a command is supplied, it must be entirely contained within the second argument β hence the quotes. Don't forget the quotes, bestie, or it's giving chaos π
π BUGS π
This manual page needs a major re-work. If somebody knows better groff than us and has more experience in writing manual pages, any patches would be greatly appreciated. (ngl this is the most honest section in any manpage ever, we respect the vulnerability π₯Ή)
π SEE ALSO π
exim(8)/usr/share/doc/exim4-base/
π AUTHOR π
This manual page was stitched together from spec.txt by Andreas Metzler <ametzler at downhill.at.eu.org>, for the Debian GNU/Linux system (but may be used by others). Slay, Andreas π«‘π
and that's the whole page, bestie!! π This beauty comes from the Exim documentation set, and the page itself is dated May 12, 2020 β so go forth, lock those mailboxes responsibly, restore those timestamps, and stay iconic β¨ππ
π¦ where this page comes from
- debian bookworm: exim4-base 4.96-15+deb12u10
- debian trixie: exim4-base 4.98.2-1+deb13u4
- debian trixie: exim4-base 4.98.2-1+deb13u5
- ubuntu jammy: exim4-base 4.95-4ubuntu2
- ubuntu jammy: exim4-base 4.95-4ubuntu2.12
- ubuntu noble: exim4-base 4.97-4ubuntu4
- ubuntu noble: exim4-base 4.97-4ubuntu4.8
- ubuntu questing: exim4-base 4.98.2-1ubuntu2
- ubuntu questing: exim4-base 4.98.2-1ubuntu2.3
- ubuntu resolute: exim4-base 4.99.1-1ubuntu1
- ubuntu resolute: exim4-base 4.99.1-1ubuntu1.5
- ubuntu stonking: exim4-base 4.99.4-1ubuntu5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms