{
    "content": [
        {
            "type": "text",
            "text": "# maildropgdbm (info)\n\n## NAME\n\nmaildropgdbm - GDBM/DB support in maildrop\n\n## SYNOPSIS\n\ngdbmopen(filename, mode)\ngdbmclose\ngdbmfetch(key [,default])\ngdbmstore(key,value)\n\n## DESCRIPTION\n\nThe gdbm family of functions provides access to the GDBM library - a\nlibrary of routines that manage simple database files. The library\nprovides a way of quickly storing and looking up key/data pairs.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **AUTHOR**\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "maildropgdbm",
        "section": "",
        "mode": "info",
        "summary": "maildropgdbm - GDBM/DB support in maildrop",
        "synopsis": "gdbmopen(filename, mode)\ngdbmclose\ngdbmfetch(key [,default])\ngdbmstore(key,value)",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 124,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 10,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "maildropgdbm - GDBM/DB support in maildrop\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "gdbmopen(filename, mode)\n\ngdbmclose\n\ngdbmfetch(key [,default])\n\ngdbmstore(key,value)\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The gdbm family of functions provides access to the GDBM library - a\nlibrary of routines that manage simple database files. The library\nprovides a way of quickly storing and looking up key/data pairs.\n\nGDBM support in maildrop is optional, and may not be available to you.\n\nGDBM support in maildrop can optionally be implemented using the DB\nlibrary. This option is selected by the system administrator. If this\nis the case, these functions still work exactly as described below,\nexcept that they will operate on DB hash files, instead of GDBM files.\n\nTo see whether GDBM or DB support is used, run the command \"maildrop\n-v\".\n\nGDBM support is minimal, and simplistic. A filter file may have only\none gdbm file open at the same time. However, the filter file can close\nthe current gdbm file, and open another one. If another filter file is\nincluded using the include statement, the included filter file may open\nits own, separate, gdbm file.\n\nA GDBM file contains a list of key/value pairs. All keys in the GDBM\nfile are unique. After storing an arbitrary key/value pair in the GDBM\nfile, the value associated with the given key can be quickly located\nand retrieved.\n\ngdbmclose - close gdbm file\ngdbmclose\n\nThis function closes the current GDBM file.\n\ngdbmfetch - retrieve data\ngdbmfetch (key [, options] [, default])\n\nThis function retrieves the data for the given key.  key is the key to\nretrieve. The gdbmfetch function returns the data associated with this\nkey. If the key does not exist in the GDBM file, gdbmfetch returns the\ndefault argument. If the default argument is not specified, gdbmfetch\nreturns empty text. Please note that the default argument is not\nactually evaluated unless the key does not exist in the GDBM file.\n\nThe options argument specifies additional maildrop value-added\nfeatures. The following functionality is not available in the GDBM\nlibrary, but is rather provided by maildrop.\n\nIf the options argument is set to \"D\", and the key could not be found\nin the GDBM database, and the key is of the form \"user@domain\",\nmaildrop will then attempt to look up the key \"user@\". If that key is\nalso not found, maildrop finally looks up the key \"domain\".\n\nIf \"domain\" is also not found, and domain is of the form \"a.b.c.d.tld\"\n(with variable number of period-separated sections), maildrop then\nattempts to look up the key \"b.c.d.tld\". If that key is not found,\nmaildrop tries \"c.d.tld\", and so on, until a key is found, or there are\nno more subdomains to remove, at which point gdbmfetch will return\neither the default argument, or empty text.\n\nIf the options argument is set to \"D\", and the key could not be found\nin the GDBM database, and the key is of the form \"a.b.c.d.tld\" (with\nvariable number of period-separated sections), maildrop will also\nattempt to look up keys for successive higher-level domains in the GDBM\ndatabase.\n\nNote\nGDBM databases are case sensitive. Make sure that the GDBM database\nis created using lowercase letters only, and use the tolower[1]\nfunction to convert the key to lowercase.\n\nIf the options argument is \"I\", and the key is not in the GDBM\ndatabase, and the key is of the form \"w.x.y.z\" (with variable number of\nperiod-separated sections), maildrop then tries to look up the key\n\"w.x.y\", then \"w.x\", until a key is found, or there are no more\nsections to remove. Use this feature to look up IP-address based GDBM\nlists.\n\nNote\nThese features are implemented by brute force: if the query doesn't\nsucceed, try again. Take note of potential denial-of-service\nattacks where key is set to a long text string consisting mostly of\nperiods, which will result in numerous GDBM queries that will take\nan excessive amount of time to complete.\n\ngdbmopen - open gdbm file\ngdbmopen (file [, mode])\n\ngdbmopen opens the indicated GDBM file. The optional second argument\nspecifies the following:\n\n\"R\"\nOpen this GDBM file for reading.\n\n\"W\"\nOpen this GDBM file for reading and writing.\n\n\"C\"\nOpen this GDBM file for reading and writing. If the GBDM file\ndoesn't exist, create it.\n\n\"N\"\nCreate a new GDBM file. If the file exists, the existing file is\ndeleted. The file is opened for reading and writing.\n\nThe mode argument defaults to \"R\" is used. In embedded mode, only \"R\"\nis allowed.\n\nThe GDBM library allows multiple processes to read the same GDBM file\nat the same time, but it does not allow multiple access when the GDBM\nfile is open for writing. Using flock[2] or dotlock[3] is highly\nrecommended.\n\nIn delivery mode, maildrop runs from the recipient's home directory.\nKeep that in mind while specifying the filename.\n\nThe gdbmopen function returns 0 if the GDBM file was successfully\nopened, non-zero otherwise.\n\ngdbmstore - store data\ngdbmstore(key, value)\n\nkey is the key value to store in the GDBM file.  value is the value to\nstore. If key already exists in the GDBM file, value replacest the old\nvalue. The gdbmstore function is only permitted if the GDBM file is\nopened for writing. If gdbmopen opened the GDBM file for reading only,\ngdbmstore will return -1. Otherwise, gdbmstore returns 0.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Sam Varshavchik\nAuthor\n",
                "subsections": []
            },
            "NOTES": {
                "content": "1. tolower\nhttp://www.courier-mta.org/maildrop/maildropfilter.html#tolower\n\n2. flock\nhttp://www.courier-mta.org/maildrop/maildropfilter.html#flock\n\n3. dotlock\nhttp://www.courier-mta.org/maildrop/maildropfilter.html#dotlock\n\nCourier Mail Server               06/20/2015                   MAILDROPGDBM(7)",
                "subsections": []
            }
        }
    }
}