# makedatprog(1) - man - phpMan

[MAKEDAT(1)](https://www.chedong.com/phpMan.php/man/MAKEDAT/1/markdown)                             Double Precision, Inc.                             [MAKEDAT(1)](https://www.chedong.com/phpMan.php/man/MAKEDAT/1/markdown)



## NAME
       makedat - create GDBM/DB files for maildrop

## SYNOPSIS
       **makedat** {-src=_textfile_} {-tmp=_tmpfile_} {-file=_gdbmfile_} [-cidr]

## DESCRIPTION
       The gdbm family of functions in **maildrop** provides access to GDBM/DB databases - simple
       database files. The gdbm family of functions provide a way of quickly storing and looking up
       key/data pairs.

       You can use any program to create GDBM/DB database files.  **makedat** is a quick utility to
       create GDBM or DB files from plain text files.

       The system administrator selects whether **maildrop** uses GDBM or DB database files and whether
       **makedat** creates GDBM or DB database files as well.

       The **makedat** command may not be available to you. GDBM/DB support in **maildrop** is optional, and
       the system administrator may choose not to install GDBM/DB support and the **makedat** command.

       To see whether GDBM or DB support is being used, run the command "**maildrop** **-v**".

       The _textfile_ argument to **makedat** is a plain text file containing key/value pairs. Each line
       in the text file contains a key value, followed by a tab and a data value. The data value may
       be omitted, which defaults to "1". For example, the following three lines:

           example.com

           domain.com<tab>ok

           foo.domain.com<tab>bad

       Three key/value pairs are created: example.com, value "1"; domain.com, value "ok", and
       "foo.domain.com", value "bad".

       Empty lines in _textfile_, and lines starting with the # character, are ignored.

       _textfile_ can be "-", in which case standard input is used.

       _gdbmfile_ is the GDBM/DB file to create. If this file exists, its existing contents are
       replaced.

       _tmpfile_ is a name of a temporary file in the same directory as _gdbmfile_.  _tmpfile_ is used by
       **makedat** to create the GDBM file, then _tmpfile_ is renamed to _gdbmfile_.

       This approach foregoes any need for locking in order to be able to dynamically update GDBM/DB
       files used by **maildrop**'s gdbm functions. However, **makedat** does not use any locks on _tmpfile_,
       so multiple instances of **makedat** using the same _tmpfile_ are prohibited.

       The **-cidr** flag specifies that the key is an IP netblock in CIDR notation. This flag requires
       the [Net::CIDR](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ACIDR/markdown) Perl module to be installed separately. Download [Net::CIDR](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ACIDR/markdown) from
       **<http://www.cpan.org>**.

## BUGS
       There are historical reasons why database functions in maildrop are called gdbm functions.
       The initial implementation used GDBM functions exclusively. The ability to use the DB library
       instead of the GDBM library has been added later.

## EXAMPLE
           makedat blacklist /etc/mail/blacklist.tmp /etc/mail/blacklist.dat

       Takes blacklist, and creates /etc/mail/blacklist.dat, using /etc/mail/blacklist.tmp as a
       temporary file.

## SEE ALSO
       [**maildrop**(1)](https://www.chedong.com/phpMan.php/man/maildrop/1/markdown)[1], [**maildropgdbm**(5)](https://www.chedong.com/phpMan.php/man/maildropgdbm/5/markdown)[2].

## AUTHOR
### Sam Varshavchik
           Author

## NOTES
        1. [**maildrop**(1)](https://www.chedong.com/phpMan.php/man/maildrop/1/markdown)
           <http://www.courier-mta.org/maildrop/maildrop.html>

        2. [**maildropgdbm**(5)](https://www.chedong.com/phpMan.php/man/maildropgdbm/5/markdown)
           <http://www.courier-mta.org/maildrop/maildropgdbm.html>



Courier Mail Server                          06/20/2015                                   [MAKEDAT(1)](https://www.chedong.com/phpMan.php/man/MAKEDAT/1/markdown)
