{
    "mode": "man",
    "parameter": "maildropgdbm",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/maildropgdbm/7/json",
    "generated": "2026-07-05T07:36:42Z",
    "synopsis": "gdbmopen(filename, mode)\ngdbmclose\ngdbmfetch(key [,default])\ngdbmstore(key,value)",
    "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 library of routines that\nmanage simple database files. The library provides a way of quickly storing and looking up\nkey/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 library. This option is\nselected by the system administrator. If this is the case, these functions still work exactly\nas described below, except 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 -v\".\n\nGDBM support is minimal, and simplistic. A filter file may have only one gdbm file open at\nthe same time. However, the filter file can close the current gdbm file, and open another\none. If another filter file is included using the include statement, the included filter file\nmay open its own, separate, gdbm file.\n\nA GDBM file contains a list of key/value pairs. All keys in the GDBM file are unique. After\nstoring an arbitrary key/value pair in the GDBM file, the value associated with the given key\ncan be quickly located and retrieved.\n",
            "subsections": [
                {
                    "name": "gdbmclose - close gdbm file",
                    "content": "gdbmclose\n\nThis function closes the current GDBM file.\n"
                },
                {
                    "name": "gdbmfetch - retrieve data",
                    "content": "gdbmfetch (key [, options] [, default])\n\nThis function retrieves the data for the given key.  key is the key to retrieve. The\ngdbmfetch function returns the data associated with this key. If the key does not exist in\nthe GDBM file, gdbmfetch returns the default argument. If the default argument is not\nspecified, gdbmfetch returns 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 features. The following\nfunctionality is not available in the GDBM library, but is rather provided by maildrop.\n\nIf the options argument is set to \"D\", and the key could not be found in the GDBM database,\nand the key is of the form \"user@domain\", maildrop will then attempt to look up the key\n\"user@\". If that key is also 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\" (with variable number\nof period-separated sections), maildrop then attempts to look up the key \"b.c.d.tld\". If that\nkey is not found, maildrop tries \"c.d.tld\", and so on, until a key is found, or there are no\nmore subdomains to remove, at which point gdbmfetch will return either the default argument,\nor empty text.\n\nIf the options argument is set to \"D\", and the key could not be found in the GDBM database,\nand the key is of the form \"a.b.c.d.tld\" (with variable number of period-separated sections),\nmaildrop will also attempt 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 is created using\nlowercase letters only, and use the tolower[1] function to convert the key to lowercase.\n\nIf the options argument is \"I\", and the key is not in the GDBM database, and the key is of\nthe form \"w.x.y.z\" (with variable number of period-separated sections), maildrop then tries\nto look up the key \"w.x.y\", then \"w.x\", until a key is found, or there are no more sections\nto remove. Use this feature to look up IP-address based GDBM lists.\n\nNote\nThese features are implemented by brute force: if the query doesn't succeed, try again.\nTake note of potential denial-of-service attacks where key is set to a long text string\nconsisting mostly of periods, which will result in numerous GDBM queries that will take\nan excessive amount of time to complete.\n"
                },
                {
                    "name": "gdbmopen - open gdbm file",
                    "content": "gdbmopen (file [, mode])\n\ngdbmopen opens the indicated GDBM file. The optional second argument specifies 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 doesn't exist, create it.\n\n\"N\"\nCreate a new GDBM file. If the file exists, the existing file is deleted. The file is\nopened for reading and writing.\n\nThe mode argument defaults to \"R\" is used. In embedded mode, only \"R\" is allowed.\n\nThe GDBM library allows multiple processes to read the same GDBM file at the same time, but\nit does not allow multiple access when the GDBM file is open for writing. Using flock[2] or\ndotlock[3] is highly recommended.\n\nIn delivery mode, maildrop runs from the recipient's home directory. Keep that in mind while\nspecifying the filename.\n\nThe gdbmopen function returns 0 if the GDBM file was successfully opened, non-zero otherwise.\n"
                },
                {
                    "name": "gdbmstore - store data",
                    "content": "gdbmstore(key, value)\n\nkey is the key value to store in the GDBM file.  value is the value to store. If key already\nexists in the GDBM file, value replacest the old value. The gdbmstore function is only\npermitted if the GDBM file is opened for writing. If gdbmopen opened the GDBM file for\nreading only, gdbmstore will return -1. Otherwise, gdbmstore returns 0.\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "",
            "subsections": [
                {
                    "name": "Sam Varshavchik",
                    "content": "Author\n"
                }
            ]
        },
        "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\n\n\nCourier Mail Server                          06/20/2015                              MAILDROPGDBM(7)",
            "subsections": []
        }
    },
    "summary": "maildropgdbm - GDBM/DB support in maildrop",
    "flags": [],
    "examples": [],
    "see_also": []
}