1 '\" te 2 .\" Copyright (c) 1983 Eric P. Allman 3 .\" Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. 4 .\" Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 5 .\" 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display 6 .\" the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors. 4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific 7 .\" prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 8 .\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 9 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 .\" Copyright (c) 1998-2006, 2008 Sendmail, Inc. and its suppliers. All rights reserved. 11 .\" The following license terms and conditions apply, unless a different license is obtained from Sendmail, Inc., 6425 Christie Ave, Fourth Floor, Emeryville, CA 94608, USA, or by electronic mail at license@sendmail.com. License Terms: Use, Modification and Redistribution 12 .\" (including distribution of any modified or derived work) in source and binary forms is permitted only if each of the following conditions is met: 1. Redistributions qualify as "freeware" or "Open Source Software" under one of the following terms: (a) Redistributions are made at no charge 13 .\" beyond the reasonable cost of materials and delivery. (b) Redistributions are accompanied by a copy of the Source Code or by an irrevocable offer to provide a copy of the Source Code for up to three years at the cost of materials and delivery. Such redistributions 14 .\" must allow further use, modification, and redistribution of the Source Code under substantially the same terms as this license. For the purposes of redistribution "Source Code" means the complete compilable and linkable source code of sendmail including all modifications. 15 .\" 2. Redistributions of source code must retain the copyright notices as they appear in each source code file, these license terms, and the disclaimer/limitation of liability set forth as paragraph 6 below. 3. Redistributions in binary form must reproduce the Copyright Notice, these license 16 .\" terms, and the disclaimer/limitation of liability set forth as paragraph 6 below, in the documentation and/or other materials provided with the distribution. For the purposes of binary distribution the "Copyright Notice" refers to the following language: "Copyright (c) 1998-2004 Sendmail, 17 .\" Inc. All rights reserved." 4. Neither the name of Sendmail, Inc. nor the University of California nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. The name "sendmail" is a trademark 18 .\" of Sendmail, Inc. 5. All redistributions must comply with the conditions imposed by the University of California on certain embedded code, whose copyright notice and conditions for redistribution are as follows: (a) Copyright (c) 1988, 1993 The Regents of the University of California. 19 .\" All rights reserved. (b) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: (i) Redistributions of source code must retain the above copyright notice, this list of 20 .\" conditions and the following disclaimer. (ii) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 21 .\" (iii) Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY SENDMAIL, 22 .\" INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SENDMAIL, INC., THE REGENTS OF THE UNIVERSITY OF CALIFORNIA OR CONTRIBUTORS 23 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 25 .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. 26 .TH EDITMAP 1M "Sep 14, 2001" 27 .SH NAME 28 editmap \- query and edit single records in database maps for sendmail 29 .SH SYNOPSIS 30 .LP 31 .nf 32 \fBeditmap\fR \fB-C\fR \fIfile\fR [\fB-N\fR] [\fB-f\fR] [\fB-q\fR | \fB-u\fR | \fB-x\fR] \fImaptype\fR \fImapname\fR \fIkey\fR 33 ["\fIvalue\fR"]... 34 .fi 35 36 .SH DESCRIPTION 37 .sp 38 .LP 39 The \fBeditmap\fR command queries or edits one record in a database maps used 40 by the keyed map lookups in \fBsendmail\fR(1M). Arguments are passed on the 41 command line and output (for queries) is directed to standard output. 42 .sp 43 .LP 44 Depending on how it is compiled, \fBeditmap\fR handles up to three different 45 database formats, selected using the \fImaptype\fR parameter. See 46 \fBOPERANDS\fR. 47 .sp 48 .LP 49 If the \fBTrustedUser\fR option is set in the \fBsendmail\fR configuration 50 file and \fBeditmap\fR is invoked as root, the generated files are owned by the 51 specified \fBTrustedUser\fR. 52 .SH OPTIONS 53 .sp 54 .LP 55 The following options are supported: 56 .sp 57 .ne 2 58 .na 59 \fB\fB-C\fR \fIfile\fR\fR 60 .ad 61 .RS 11n 62 Use the specified \fBsendmail\fR configuration file (\fIfile\fR) to look up the 63 \fBTrustedUser\fR option. 64 .RE 65 66 .sp 67 .ne 2 68 .na 69 \fB\fB-f\fR\fR 70 .ad 71 .RS 11n 72 Disable the folding of all upper case letters in the key to lower case. 73 Normally, all upper case letters in the key are folded to upper case. This is 74 intended to mesh with the \fB-f\fR flag in the \fBK\fR line in 75 \fBsendmail.cf\fR. The value is never case folded. 76 .RE 77 78 .sp 79 .ne 2 80 .na 81 \fB\fB-N\fR\fR 82 .ad 83 .RS 11n 84 Include the null byte that terminates strings in the map (for alias maps). 85 .RE 86 87 .sp 88 .ne 2 89 .na 90 \fB\fB-q\fR\fR 91 .ad 92 .RS 11n 93 Query the map for the specified key. If found, print value to standard output 94 and exit with \fB0\fR. If not found then print an error message to \fBstdout\fR 95 and exit with \fBEX_UNAVAILABLE\fR. 96 .RE 97 98 .sp 99 .ne 2 100 .na 101 \fB\fB-u\fR\fR 102 .ad 103 .RS 11n 104 Update the record for key with value or inserts a new record if one doesn't 105 exist. Exits with \fB0\fR on success or \fBEX_IOERR\fR on failure. 106 .RE 107 108 .sp 109 .ne 2 110 .na 111 \fB\fB-x\fR\fR 112 .ad 113 .RS 11n 114 Delete the specific key from the map. Exit with \fB0\fR on success or 115 \fBEX_IOERR\fR on failure. 116 .RE 117 118 .SH OPERANDS 119 .sp 120 .LP 121 The following operands are supported: 122 .sp 123 .ne 2 124 .na 125 \fB\fIkey\fR\fR 126 .ad 127 .RS 12n 128 The left hand side of a record. 129 .sp 130 Each record is of the form: 131 .sp 132 .in +2 133 .nf 134 \fIkey\fR \fIvalue\fR 135 .fi 136 .in -2 137 .sp 138 139 \fIkey\fR and \fIvalue\fR are separated by white space. 140 .RE 141 142 .sp 143 .ne 2 144 .na 145 \fB\fImapname\fR \fR 146 .ad 147 .RS 12n 148 File name of the database map being created. 149 .RE 150 151 .sp 152 .ne 2 153 .na 154 \fB\fImaptype\fR \fR 155 .ad 156 .RS 12n 157 Specifies the database format. The following \fImaptype\fR parameters are 158 available: 159 .sp 160 .ne 2 161 .na 162 \fB\fBdbm\fR \fR 163 .ad 164 .RS 10n 165 Specifies \fBDBM\fR format maps. 166 .RE 167 168 .sp 169 .ne 2 170 .na 171 \fB\fBbtree\fR \fR 172 .ad 173 .RS 10n 174 Specifies B-Tree format maps. 175 .RE 176 177 .sp 178 .ne 2 179 .na 180 \fB\fBhash\fR \fR 181 .ad 182 .RS 10n 183 Specifies hash format maps. 184 .RE 185 186 .RE 187 188 .sp 189 .ne 2 190 .na 191 \fB\fIvalue\fR\fR 192 .ad 193 .RS 12n 194 The right hand side of a record. 195 .sp 196 Each record is of the form: 197 .sp 198 .in +2 199 .nf 200 \fIkey\fR \fIvalue\fR 201 .fi 202 .in -2 203 .sp 204 205 \fIkey\fR and \fIvalue\fR are separated by white space. 206 .RE 207 208 .SH SEE ALSO 209 .sp 210 .LP 211 \fBmakemap\fR(1M), \fBsendmail\fR(1M), \fBattributes\fR(5)