{
    "content": [
        {
            "type": "text",
            "text": "# mutt_dotlock (info)\n\n## NAME\n\nmuttdotlock - Lock mail spool files.\n\n## SYNOPSIS\n\nmuttdotlock [-t|-f|-u|-d] [-p] [-r retries] file\n\n## DESCRIPTION\n\nmuttdotlock implements the traditional mail spool file locking method:\nTo lock file, a file named file.lock is created. The  program  operates\nwith group mail privileges if necessary.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS**\n- **FILES**\n- **SEE ALSO**\n- **DIAGNOSTICS**\n- **NOTES**\n- **HISTORY**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "mutt_dotlock",
        "section": "",
        "mode": "info",
        "summary": "muttdotlock - Lock mail spool files.",
        "synopsis": "muttdotlock [-t|-f|-u|-d] [-p] [-r retries] file",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 3,
                "subsections": []
            }
        ],
        "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:\nTo lock file, a file named file.lock is created. The  program  operates\nwith group mail privileges if necessary.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "-t     Just  try.   muttdotlock won't actually lock a file, but inform\nthe invoking process if it's at all possible to lock file.\n\n-f     Force the lock.  If another process holds a lock on file  longer\nthan a certain amount of time, muttdotlock will break that lock\nby 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\n0, and afterwards remove file.lock.\n\n-p     Use privileges.  If given this option, muttdotlock will operate\nwith group mail  privileges  when  creating  and  deleting  lock\nfiles.\n\n-r retries\nThis  command  line option tells muttdotlock to try locking re-\ntries times before giving up or (if invoked with the -f  command\nline  option)  break a lock.  The default value is 5.  muttdot-\nlock 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\nof system memory and the like has occurred.\n\n3 - DLEXEXIST\nThe  user  wants to lock a file which has been locked by another\nprocess already.  If muttdotlock is invoked with the -f command\nline  option,  muttdotlock won't generate this error, but break\nother processes' locks.\n\n4 - DLEXNEEDRPIVS\nThis return value only occurs if muttdotlock has  been  invoked\nwith  the  -t  command  line option.  It means that muttdotlock\nwill have to use its group mail privileges to lock file.\n\n5 - DLEXIMPOSSIBLE\nThis return value only occurs if muttdotlock has  been  invoked\nwith  the -t command line option.  It means that muttdotlock is\nunable to lock file even with group mail privileges.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "muttdotlock tries to implement an NFS-safe dotlocking method which was\nborrowed from lockfile (1).\n\nIf  the  user  can't  open file for reading with his normal privileges,\nmuttdotlock will return the DLEXERROR exit value  to  avoid  certain\nattacks  against  other  users'  spool files. The code carefully avoids\nrace 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\ncreated to avoid running mutt with group mail privileges.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Thomas Roessler <roessler@does-not-exist.org>\n\nUnix                              AUGUST 1999                       dotlock(1)",
                "subsections": []
            }
        }
    }
}