1<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 3 4<html> 5 6<head> 7 8<title>Postfix VERP Howto</title> 9 10<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 11<link rel='stylesheet' type='text/css' href='postfix-doc.css'> 12 13</head> 14 15<body> 16 17<h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix VERP Howto</h1> 18 19<hr> 20 21<h2>Postfix VERP support</h2> 22 23<p> Postfix versions 1.1 and later support variable envelope return 24path addresses on request. When VERP style delivery is requested, 25each recipient of a message receives a customized copy of the 26message, with his/her own recipient address encoded in the envelope 27sender address. </p> 28 29<p> For example, when VERP style delivery is requested, Postfix 30delivers mail from "<tt>owner-listname@origin</tt>" for a recipient 31"<tt>user@domain</tt>", with a sender address that encodes the 32recipient as follows: </p> 33 34<blockquote> 35<pre> 36owner-listname+user=domain@origin 37</pre> 38</blockquote> 39 40<p> Thus, undeliverable mail can reveal the undeliverable recipient 41address without requiring the list owner to parse bounce messages. 42</p> 43 44<p> The VERP concept was popularized by the qmail MTA and by the ezmlm 45mailing list manager. See http://cr.yp.to/proto/verp.txt for the 46ideas behind this concept. </p> 47 48<p> Topics covered in this document: </p> 49 50<ul> 51 52<li> <a href="#config"> Postfix VERP configuration parameters </a> 53 54<li> <a href="#majordomo"> Using VERP with majordomo etc. mailing lists </a> 55 56<li> <a href="#smtp"> VERP support in the Postfix SMTP server</a> 57 58<li> <a href="#sendmail"> VERP support in the Postfix sendmail command </a> 59 60<li> <a href="#qmqp"> VERP support in the Postfix QMQP server </a> 61 62</ul> 63 64<h2> <a name="config"> Postfix VERP configuration parameters </a> </h2> 65 66With Postfix, the whole process is controlled by four configuration 67parameters. 68 69<dl> 70 71<dt> default_verp_delimiters (default value: +=) 72 73 <dd> <p> What VERP delimiter characters Postfix uses when VERP 74 style delivery is requested but no explicit delimiters are 75 specified. </p> 76 77<dt> verp_delimiter_filter (default: -+=) 78 79 <dd> <p> What characters Postfix accepts as VERP delimiter 80 characters on the sendmail command line and in SMTP commands. 81 Many characters must not be used as VERP delimiter characters, 82 either because they already have a special meaning in email 83 addresses (such as the @ or the %), because they are used as 84 part of a username or domain name (such as alphanumerics), or 85 because they are non-ASCII or control characters. And who 86 knows, some characters may tickle bugs in vulnerable software, 87 and we would not want that to happen. </p> </dd> 88 89<dt> smtpd_authorized_verp_clients (default value: none) 90 91 <dd> <p> What SMTP clients are allowed to request VERP style 92 delivery. The Postfix QMQP server uses its own access control 93 mechanism, and local submission (via /usr/sbin/sendmail etc.) 94 is always authorized. To authorize a host, list its name, IP 95 address, subnet (net/mask) or parent .domain. </p> 96 97 <p> With Postfix versions 1.1 and 2.0, this parameter is called 98 authorized_verp_clients (default: $mynetworks). </p> </dd> 99 100<dt> disable_verp_bounces (default: no) 101 102 <dd> <p> Send one bounce report for multi-recipient VERP mail, 103 instead of one bounce report per recipient. The default, 104 one per recipient, is what ezmlm needs. </p> </dd> 105 106</dl> 107 108<h2> <a name="majordomo"> Using VERP with majordomo etc. mailing lists </a> </h2> 109 110<p> In order to make VERP useful with majordomo etc. mailing lists, 111you would configure the list manager to submit mail according 112to one of the following two forms: </p> 113 114<p> Postfix 2.3 and later: </p> 115 116<blockquote> 117<pre> 118% sendmail -XV -f owner-listname other-arguments... 119 120% sendmail -XV+= -f owner-listname other-arguments... 121</pre> 122</blockquote> 123 124<p> Postfix 2.2 and earlier (Postfix 2.3 understands the old syntax 125for backwards compatibility, but will log a warning that reminds 126you of the new syntax): </p> 127 128<blockquote> 129<pre> 130% sendmail -V -f owner-listname other-arguments... 131 132% sendmail -V+= -f owner-listname other-arguments... 133</pre> 134</blockquote> 135 136<p> The first form uses the default main.cf VERP delimiter characters. 137The second form allows you to explicitly specify the VERP delimiter 138characters. The example shows the recommended values. </p> 139 140<p> This text assumes that you have set up an owner-listname alias 141that routes undeliverable mail to a real person: </p> 142 143<blockquote> 144<pre> 145/etc/aliases: 146 owner-listname: yourname+listname 147</pre> 148</blockquote> 149 150<p> In order to process bounces we are going to make extensive use 151of address extension tricks. </p> 152 153<p> You need to tell Postfix that + is the separator between an 154address and its optional address extension, that address extensions 155are appended to .forward file names, and that address extensions 156are to be discarded when doing alias expansions: </p> 157 158<blockquote> 159<pre> 160/etc/postfix/main.cf: 161 recipient_delimiter = + 162 forward_path = $home/.forward${recipient_delimiter}${extension}, 163 $home/.forward 164 propagate_unmatched_extensions = canonical, virtual 165</pre> 166</blockquote> 167 168<p> (the last two parameter settings are default settings). </p> 169 170<p> You need to set up a file named .forward+listname with the 171commands that process all the mail that is sent to the owner-listname 172address: </p> 173 174<blockquote> 175<pre> 176~/.forward+listname: 177 "|/some/where/command ..." 178</pre> 179</blockquote> 180 181<p> With this set up, undeliverable mail for user@domain will be returned 182to the following address: </p> 183 184<blockquote> 185<pre> 186owner-listname+user=domain@your.domain 187</pre> 188</blockquote> 189 190<p> which is processed by the command in your .forward+listname file. 191The message should contain, among others, a To: header with the 192encapsulated recipient sender address: </p> 193 194<blockquote> 195<pre> 196To: owner-listname+user=domain@your.domain 197</pre> 198</blockquote> 199 200<p> It is left as an exercise for the reader to parse the To: header 201line and to pull out the user=domain part from the recipient address. 202</p> 203 204<h2> <a name="smtp"> VERP support in the Postfix SMTP server </a> </h2> 205 206<p> The Postfix SMTP server implements a command XVERP to enable 207VERP style delivery. The syntax allows two forms: </p> 208 209<blockquote> 210<pre> 211MAIL FROM:<sender@domain> XVERP 212 213MAIL FROM:<sender@domain> XVERP=+= 214</pre> 215</blockquote> 216 217<p> The first form uses the default main.cf VERP delimiters, the 218second form overrides them explicitly. The values shown are the 219recommended ones. </p> 220 221<p> You can use the smtpd_command_filter feature to append XVERP 222to SMTP commands from legacy software. This requires Postfix 2.7 223or later. </p> 224 225<blockquote> 226<pre> 227/etc/postfix/main.cf: 228 smtpd_command_filter = pcre:/etc/postfix/append_verp.pcre 229 smtpd_authorized_verp_clients = $mynetworks 230 231/etc/postfix/append_verp.pcre: 232 /^(MAIL FROM:<listname@example\.com>.*)/ $1 XVERP 233</pre> 234</blockquote> 235 236<h2> <a name="sendmail"> VERP support in the Postfix sendmail command </a> </h2> 237 238<p> The Postfix sendmail command has a -V flag to request VERP style 239delivery. Specify one of the following two forms: </p> 240 241<p> Postfix 2.3 and later:</p> 242<blockquote> 243<pre> 244% sendmail -XV -f owner-listname .... 245 246% sendmail -XV+= -f owner-listname .... 247</pre> 248</blockquote> 249 250<p> Postfix 2.2 and earlier (Postfix 2.3 understands the old syntax 251for backwards compatibility, but will log a warning that reminds 252you of the new syntax): </p> 253 254<blockquote> 255<pre> 256% sendmail -V -f owner-listname .... 257 258% sendmail -V+= -f owner-listname .... 259</pre> 260</blockquote> 261 262<p> The first form uses the default main.cf VERP delimiters, the 263second form overrides them explicitly. The values shown are the 264recommended ones. </p> 265 266<h2> <a name="qmqp"> VERP support in the Postfix QMQP server </a> </h2> 267 268<p> When the Postfix QMQP server receives mail with an envelope 269sender address of the form: </p> 270 271<blockquote> 272<pre> 273listname-@your.domain-@[] 274</pre> 275</blockquote> 276 277<p> Postfix generates sender addresses 278"<tt>listname-user=domain@your.domain</tt>", using "-=" as the VERP 279delimiters because qmail/ezmlm expect this. </p> 280 281<p> More generally, a sender address of "<tt>prefix@origin-@[]</tt>" 282requests VERP style delivery with sender addresses of the form 283"<tt>prefixuser=domain@origin</tt>". However, Postfix allows only 284VERP delimiters that are specified with the verp_delimiter_filter 285parameter. In particular, the "=" delimiter is required for qmail 286compatibility (see the qmail addresses(5) manual page for details). 287 288</body> 289 290</html> 291