summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man1/makedat.maildrop.1
blob: da9c90c8d8f42e51d816eafd3b81a3db7ff9bf6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
'\" t
.\"<!-- Copyright 1998 - 2007 Double Precision, Inc.  See COPYING for -->
.\"<!-- distribution information. -->
.\"     Title: makedat
.\"    Author: Sam Varshavchik
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 06/20/2015
.\"    Manual: Double Precision, Inc.
.\"    Source: Courier Mail Server
.\"  Language: English
.\"
.TH "MAKEDAT" "1" "06/20/2015" "Courier Mail Server" "Double Precision, Inc\&."
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
makedat \- create GDBM/DB files for maildrop
.SH "SYNOPSIS"
.HP \w'\fBmakedat\fR\ 'u
\fBmakedat\fR {\-src=\fItextfile\fR} {\-tmp=\fItmpfile\fR} {\-file=\fIgdbmfile\fR} [\-cidr]
.SH "DESCRIPTION"
.PP
The gdbm family of functions in
\fBmaildrop\fR
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\&.
.PP
You can use any program to create GDBM/DB database files\&.
\fBmakedat\fR
is a quick utility to create GDBM or DB files from plain text files\&.
.PP
The system administrator selects whether
\fBmaildrop\fR
uses GDBM or DB database files and whether
\fBmakedat\fR
creates GDBM or DB database files as well\&.
.PP
The
\fBmakedat\fR
command may not be available to you\&. GDBM/DB support in
\fBmaildrop\fR
is optional, and the system administrator may choose not to install GDBM/DB support and the
\fBmakedat\fR
command\&.
.PP
To see whether GDBM or DB support is being used, run the command "\fBmaildrop \-v\fR"\&.
.PP
The
\fItextfile\fR
argument to
\fBmakedat\fR
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:
.sp
.if n \{\
.RS 4
.\}
.nf
example\&.com

domain\&.com<tab>ok

foo\&.domain\&.com<tab>bad
.fi
.if n \{\
.RE
.\}
.PP
Three key/value pairs are created: example\&.com, value "1"; domain\&.com, value "ok", and "foo\&.domain\&.com", value "bad"\&.
.PP
Empty lines in
\fItextfile\fR, and lines starting with the # character, are ignored\&.
.PP
\fItextfile\fR
can be "\-", in which case standard input is used\&.
.PP
\fIgdbmfile\fR
is the GDBM/DB file to create\&. If this file exists, its existing contents are replaced\&.
.PP
\fItmpfile\fR
is a name of a temporary file in the same directory as
\fIgdbmfile\fR\&.
\fItmpfile\fR
is used by
\fBmakedat\fR
to create the GDBM file, then
\fItmpfile\fR
is renamed to
\fIgdbmfile\fR\&.
.PP
This approach foregoes any need for locking in order to be able to dynamically update GDBM/DB files used by
\fBmaildrop\fR\*(Aqs gdbm functions\&. However,
\fBmakedat\fR
does not use any locks on
\fItmpfile\fR, so multiple instances of
\fBmakedat\fR
using the same
\fItmpfile\fR
are prohibited\&.
.PP
The
\fB\-cidr\fR
flag specifies that the key is an IP netblock in CIDR notation\&. This flag requires the
Net::CIDR
Perl module to be installed separately\&. Download Net::CIDR from
\m[blue]\fBhttp://www\&.cpan\&.org\fR\m[]\&.
.SH "BUGS"
.PP
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\&.
.SH "EXAMPLE"
.sp
.if n \{\
.RS 4
.\}
.nf
makedat blacklist /etc/mail/blacklist\&.tmp /etc/mail/blacklist\&.dat
.fi
.if n \{\
.RE
.\}
.PP
Takes
blacklist, and creates
/etc/mail/blacklist\&.dat, using
/etc/mail/blacklist\&.tmp
as a temporary file\&.
.SH "SEE ALSO"
.PP
\m[blue]\fB\fBmaildrop\fR(1)\fR\m[]\&\s-2\u[1]\d\s+2,
\m[blue]\fB\fBmaildropgdbm\fR(5)\fR\m[]\&\s-2\u[2]\d\s+2\&.
.SH "AUTHOR"
.PP
\fBSam Varshavchik\fR
.RS 4
Author
.RE
.SH "NOTES"
.IP " 1." 4
\fBmaildrop\fR(1)
.RS 4
\%http://www.courier-mta.org/maildrop/maildrop.html
.RE
.IP " 2." 4
\fBmaildropgdbm\fR(5)
.RS 4
\%http://www.courier-mta.org/maildrop/maildropgdbm.html
.RE