1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "https://www.w3.org/TR/html4/loose.dtd"> 3 <html> <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <link rel='stylesheet' type='text/css' href='postfix-doc.css'> 6 <title> Postfix manual - postalias(1) </title> 7 </head> <body> <pre> 8 POSTALIAS(1) POSTALIAS(1) 9 10 <b><a name="name">NAME</a></b> 11 postalias - Postfix alias database maintenance 12 13 <b><a name="synopsis">SYNOPSIS</a></b> 14 <b>postalias</b> [<b>-Nfijnoprsuvw</b>] [<b>-c</b> <i>config</i><b>_</b><i>dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>] 15 [<i>file</i><b>_</b><i>type</i>:]<i>file</i><b>_</b><i>name</i> ... 16 17 <b><a name="description">DESCRIPTION</a></b> 18 The <a href="postalias.1.html"><b>postalias</b>(1)</a> command creates or queries one or more Postfix alias 19 databases, or updates an existing one. The input and output file for- 20 mats are expected to be compatible with Sendmail version 8, and are 21 expected to be suitable for use as NIS alias maps. 22 23 If the result files do not exist they will be created with the same 24 group and other read permissions as their source file. 25 26 While a database update is in progress, signal delivery is postponed, 27 and an exclusive, advisory, lock is placed on the entire database, in 28 order to avoid surprises in spectator processes. 29 30 The format of Postfix alias input files is described in <a href="aliases.5.html"><b>aliases</b>(5)</a>. 31 32 By default the lookup key is mapped to lowercase to make the lookups 33 case insensitive; as of Postfix 2.3 this case folding happens only with 34 tables whose lookup keys are fixed-case strings such as <a href="DATABASE_README.html#types">btree</a>:, <a href="DATABASE_README.html#types">dbm</a>: or 35 <a href="DATABASE_README.html#types">hash</a>:. With earlier versions, the lookup key is folded even with tables 36 where a lookup field can match both upper and lower case text, such as 37 <a href="regexp_table.5.html">regexp</a>: and <a href="pcre_table.5.html">pcre</a>:. This resulted in loss of information with $<i>number</i> 38 substitutions. 39 40 Options: 41 42 <b>-c</b> <i>config</i><b>_</b><i>dir</i> 43 Read the <a href="postconf.5.html"><b>main.cf</b></a> configuration file in the named directory 44 instead of the default configuration directory. 45 46 <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one entry per map. 47 The exit status is zero when the requested information was 48 found. 49 50 If a key value of <b>-</b> is specified, the program reads key values 51 from the standard input stream. The exit status is zero when at 52 least one of the requested keys was found. 53 54 <b>-f</b> Do not fold the lookup key to lower case while creating or 55 querying a table. 56 57 With Postfix version 2.3 and later, this option has no effect 58 for regular expression tables. There, case folding is controlled 59 by appending a flag to a pattern. 60 61 <b>-i</b> Incremental mode. Read entries from standard input and do not 62 truncate an existing database. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> creates 63 a new database from the entries in <i>file</i><b>_</b><i>name</i>. 64 65 <b>-j</b> JSON output. Format the output from <b>-q</b> and <b>-s</b> as one <b>{"</b><i>key</i><b>":</b> 66 <b>"</b><i>value</i><b>"}</b> object per line. 67 68 This feature is available in Postfix version 3.11 and later. 69 70 <b>-N</b> Include the terminating null character that terminates lookup 71 keys and values. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> does whatever is the 72 default for the host operating system. 73 74 <b>-n</b> Don't include the terminating null character that terminates 75 lookup keys and values. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> does whatever 76 is the default for the host operating system. 77 78 <b>-o</b> Do not release root privileges when processing a non-root input 79 file. By default, <a href="postalias.1.html"><b>postalias</b>(1)</a> drops root privileges and runs as 80 the source file owner instead. 81 82 <b>-p</b> Do not inherit the file access permissions from the input file 83 when creating a new file. Instead, create a new file with 84 default access permissions (mode 0644). 85 86 <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and write the first value 87 found to the standard output stream. The exit status is zero 88 when the requested information was found. 89 90 Note: this performs a single query with the key as specified, 91 and does not make iterative queries with substrings of the key 92 as described in the <a href="aliases.5.html">aliases(5)</a> manual page. 93 94 If a key value of <b>-</b> is specified, the program reads key values 95 from the standard input stream and writes one line of <i>key: value</i> 96 output for each key that was found. The exit status is zero when 97 at least one of the requested keys was found. 98 99 <b>-r</b> When updating a table, do not complain about attempts to update 100 existing entries, and make those updates anyway. 101 102 <b>-s</b> Retrieve all database elements, and write one line of <i>key: value</i> 103 output for each element. The elements are printed in database 104 order, which is not necessarily the same as the original input 105 order. This feature is available in Postfix version 2.2 and 106 later, and is not available for all database types. 107 108 <b>-u</b> Disable UTF-8 support. UTF-8 support is enabled by default when 109 "<a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> = yes". It requires that keys and values are 110 valid UTF-8 strings. 111 112 <b>-v</b> Enable verbose logging for debugging purposes. Multiple <b>-v</b> 113 options make the software increasingly verbose. 114 115 <b>-w</b> When updating a table, do not complain about attempts to update 116 existing entries, and ignore those attempts. 117 118 Arguments: 119 120 <i>file</i><b>_</b><i>type</i> 121 The database type. To find out what types are supported, use the 122 "<b>postconf -m</b>" command. 123 124 When no <i>file</i><b>_</b><i>type</i> is specified, the software uses the database 125 type specified via the <b><a href="postconf.5.html#default_database_type">default_database_type</a></b> configuration 126 parameter. The default value for this parameter depends on the 127 host environment. 128 129 The <a href="postalias.1.html"><b>postalias</b>(1)</a> command can query any supported file type, but 130 it can create only the following file types: 131 132 <b>btree</b> The output is a btree file, named <i>file</i><b>_</b><i>name</i><b>.db</b>. This is 133 available on systems with support for <b>db</b> databases. 134 135 <b>cdb</b> The output is one file named <i>file</i><b>_</b><i>name</i><b>.cdb</b>. This is 136 available on systems with support for <b>cdb</b> databases. 137 138 <b>dbm</b> The output consists of two files, named <i>file</i><b>_</b><i>name</i><b>.pag</b> and 139 <i>file</i><b>_</b><i>name</i><b>.dir</b>. This is available on systems with support 140 for <b>dbm</b> databases. 141 142 <b>fail</b> A table that reliably fails all requests. The lookup ta- 143 ble name is used for logging only. This table exists to 144 simplify Postfix error tests. 145 146 <b>hash</b> The output is a hashed file, named <i>file</i><b>_</b><i>name</i><b>.db</b>. This is 147 available on systems with support for <b>db</b> databases. 148 149 <b>lmdb</b> The output is a btree-based file, named <i>file</i><b>_</b><i>name</i><b>.lmdb</b>. 150 <b>lmdb</b> supports concurrent writes and reads from different 151 processes, unlike other supported file-based tables. 152 This is available on systems with support for <b>lmdb</b> data- 153 bases. 154 155 <b>sdbm</b> The output consists of two files, named <i>file</i><b>_</b><i>name</i><b>.pag</b> and 156 <i>file</i><b>_</b><i>name</i><b>.dir</b>. This is available on systems with support 157 for <b>sdbm</b> databases. 158 159 <i>file</i><b>_</b><i>name</i> 160 The name of the alias database source file when creating a data- 161 base. 162 163 <b><a name="diagnostics">DIAGNOSTICS</a></b> 164 Problems are logged to the standard error stream and to <b>syslogd</b>(8) or 165 <a href="postlogd.8.html"><b>postlogd</b>(8)</a>. No output means that no problems were detected. Duplicate 166 entries are skipped and are flagged with a warning. 167 168 <a href="postalias.1.html"><b>postalias</b>(1)</a> terminates with zero exit status in case of success 169 (including successful "<b>postalias -q</b>" lookup) and terminates with 170 non-zero exit status in case of failure. 171 172 <b><a name="environment">ENVIRONMENT</a></b> 173 <b>MAIL_CONFIG</b> 174 Directory with Postfix configuration files. 175 176 <b>MAIL_VERBOSE</b> 177 Enable verbose logging for debugging purposes. 178 179 <b><a name="configuration_parameters">CONFIGURATION PARAMETERS</a></b> 180 The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant to this pro- 181 gram. 182 183 The text below provides only a parameter summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for 184 more details including examples. 185 186 <b><a href="postconf.5.html#alias_database">alias_database</a> (see 'postconf -d' output)</b> 187 The alias databases for <a href="local.8.html"><b>local</b>(8)</a> delivery that are updated with 188 "<b>newaliases</b>" or with "<b>sendmail -bi</b>". 189 190 <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b> 191 The default location of the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> con- 192 figuration files. 193 194 <b><a href="postconf.5.html#berkeley_db_create_buffer_size">berkeley_db_create_buffer_size</a> (16777216)</b> 195 The per-table I/O buffer size for programs that create Berkeley 196 DB hash or btree tables. 197 198 <b><a href="postconf.5.html#berkeley_db_read_buffer_size">berkeley_db_read_buffer_size</a> (131072)</b> 199 The per-table I/O buffer size for programs that read Berkeley DB 200 hash or btree tables. 201 202 <b><a href="postconf.5.html#default_database_type">default_database_type</a> (see 'postconf -d' output)</b> 203 The default database type for use in <a href="newaliases.1.html"><b>newaliases</b>(1)</a>, <a href="postalias.1.html"><b>postalias</b>(1)</a> 204 and <a href="postmap.1.html"><b>postmap</b>(1)</a> commands. 205 206 <b><a href="postconf.5.html#import_environment">import_environment</a> (see 'postconf -d' output)</b> 207 The list of environment variables that a privileged Postfix 208 process will import from a non-Postfix parent process, or 209 name=value environment overrides. 210 211 <b><a href="postconf.5.html#smtputf8_enable">smtputf8_enable</a> (yes)</b> 212 Enable preliminary SMTPUTF8 support for the protocols described 213 in <a href="https://tools.ietf.org/html/rfc6531">RFC 6531</a>, <a href="https://tools.ietf.org/html/rfc6532">RFC 6532</a>, and <a href="https://tools.ietf.org/html/rfc6533">RFC 6533</a>. 214 215 <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b> 216 The syslog facility of Postfix logging. 217 218 <b><a href="postconf.5.html#syslog_name">syslog_name</a> (see 'postconf -d' output)</b> 219 A prefix that is prepended to the process name in syslog 220 records, so that, for example, "smtpd" becomes "prefix/smtpd". 221 222 Available in Postfix 2.11 and later: 223 224 <b><a href="postconf.5.html#lmdb_map_size">lmdb_map_size</a> (16777216)</b> 225 The initial OpenLDAP LMDB database size limit in bytes. 226 227 <b><a name="standards">STANDARDS</a></b> 228 <a href="https://tools.ietf.org/html/rfc822">RFC 822</a> (ARPA Internet Text Messages) 229 230 <b><a name="see_also">SEE ALSO</a></b> 231 <a href="aliases.5.html">aliases(5)</a>, format of alias database input file. 232 <a href="local.8.html">local(8)</a>, Postfix local delivery agent. 233 <a href="postconf.1.html">postconf(1)</a>, supported database types 234 <a href="postconf.5.html">postconf(5)</a>, configuration parameters 235 <a href="postmap.1.html">postmap(1)</a>, create/update/query lookup tables 236 <a href="newaliases.1.html">newaliases(1)</a>, Sendmail compatibility interface. 237 <a href="postlogd.8.html">postlogd(8)</a>, Postfix logging 238 syslogd(8), system logging 239 240 <b><a name="readme_files">README FILES</a></b> 241 <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview 242 243 <b><a name="license">LICENSE</a></b> 244 The Secure Mailer license must be distributed with this software. 245 246 <b>AUTHOR(S)</b> 247 Wietse Venema 248 IBM T.J. Watson Research 249 P.O. Box 704 250 Yorktown Heights, NY 10598, USA 251 252 Wietse Venema 253 Google, Inc. 254 111 8th Avenue 255 New York, NY 10011, USA 256 257 POSTALIAS(1) 258 </pre> </body> </html> 259