{
    "mode": "man",
    "parameter": "mutt_dotlock",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/mutt_dotlock/1/json",
    "generated": "2026-05-30T06:05:41Z",
    "synopsis": "muttdotlock [-t|-f|-u|-d] [-p] [-r retries] file",
    "sections": {
        "NAME": {
            "content": "muttdotlock - Lock mail spool files.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "muttdotlock [-t|-f|-u|-d] [-p] [-r retries] file\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "muttdotlock  implements the traditional mail spool file locking method: To lock file, a file\nnamed file.lock is created. The program operates with group mail privileges if necessary.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-t     Just try.  muttdotlock won't actually lock a file, but inform the invoking process if\nit's at all possible to lock file.\n\n-f     Force  the lock.  If another process holds a lock on file longer than a certain amount\nof time, muttdotlock will break that lock by removing the lockfile.\n\n-u     Unlock.  muttdotlock will remove file.lock.\n\n-d     Delete.  muttdotlock will lock file, remove it if it has length 0, and afterwards re‐\nmove file.lock.\n\n-p     Use privileges.  If given this option, muttdotlock will operate with group mail priv‐\nileges when creating and deleting lock files.\n\n-r retries\nThis command line option tells muttdotlock to try locking retries times before giving\nup or (if invoked with the -f command line option) break a lock.  The default value is\n5.  muttdotlock waits one second between successive locking attempts.\n",
            "subsections": []
        },
        "FILES": {
            "content": "file.lock\nThe lock file muttdotlock generates.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "fcntl(2), flock(2), lockfile(1), mutt(1)\n",
            "subsections": []
        },
        "DIAGNOSTICS": {
            "content": "muttdotlock gives all diagnostics in its return values:\n\n0 - DLEXOK\nThe program was successful.\n\n1 - DLEXERROR\nAn unspecified error such as bad command line parameters, lack of  system  memory  and\nthe like has occurred.\n\n3 - DLEXEXIST\nThe  user  wants  to lock a file which has been locked by another process already.  If\nmuttdotlock is invoked with the -f command line option, muttdotlock  won't  generate\nthis error, but break other processes' locks.\n\n4 - DLEXNEEDRPIVS\nThis  return  value  only  occurs if muttdotlock has been invoked with the -t command\nline option.  It means that muttdotlock will have to use its group mail privileges to\nlock file.\n\n5 - DLEXIMPOSSIBLE\nThis  return  value  only  occurs if muttdotlock has been invoked with the -t command\nline option.  It means that muttdotlock is unable to lock file even with  group  mail\nprivileges.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "muttdotlock  tries  to implement an NFS-safe dotlocking method which was borrowed from lock‐‐\nfile (1).\n\nIf the user can't open file for reading with his normal privileges, muttdotlock will  return\nthe  DLEXERROR  exit  value  to avoid certain attacks against other users' spool files. The\ncode carefully avoids race conditions when checking permissions; for details of all this  see\nthe comments in dotlock.c.\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "muttdotlock  is part of the Mutt mail user agent package.  It has been created to avoid run‐\nning mutt with group mail privileges.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Thomas Roessler <roessler@does-not-exist.org>\n\n\n\nUnix                                         AUGUST 1999                                  dotlock(1)",
            "subsections": []
        }
    },
    "summary": "muttdotlock - Lock mail spool files.",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "fcntl",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fcntl/2/json"
        },
        {
            "name": "flock",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/flock/2/json"
        },
        {
            "name": "lockfile",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/lockfile/1/json"
        },
        {
            "name": "mutt",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mutt/1/json"
        }
    ]
}