Victor Duchovni: > On Fri, Jan 22, 2010 at 09:16:07AM -0500, Wietse Venema wrote: > > > > The lookup keys and RHS values for virtual(5) are in rfc822 format. > > > A PCRE table can take care of this: > > > > Virtual alias lookups are done in the "unquoted" form, while > > canonical map lookups are in "quoted" form. > > No, the cleanup(8) server virtual lookup key and value are in rfc822 > quoted form, and will correctly process: > > biza...@example.com > "internal,comma"@example.com, > "internal whitespace"@example.net, > ... > > > So, the above form is good for canonical mapping, but virtual > > alias mapping would require that the quotes be stripped: > > > > See src/cleanup/cleanup_map1n.c around line 118: > > quote_822_local(state->temp1, argv->argv[arg]); > if ((lookup = mail_addr_map(maps, STR(state->temp1), propagate)) != 0) { > ... > }
I stand corrected. > Of course the address may not get that far, because the SMTP server > uses the internal form of the address when doing recipient validation: > > static int check_rcpt_maps(SMTPD_STATE *state, const char *recipient, > const char *reply_class) > { > ... > if (MATCH(rcpt_canon_maps, CONST_STR(reply->recipient)) > || MATCH(canonical_maps, CONST_STR(reply->recipient)) > || MATCH(virt_alias_maps, CONST_STR(reply->recipient))) > return (0); > > One could argue that the SMTP server should use the external form of the > recipient for these lookup, to match downstream behaviour in cleanup(8)... Indeed. There was no address validation in the initial design and implementation, so address validation support does not fit as nicely as one would like. It suffers from code duplication which leads to inconsistency. But I would rather fight the duplication than the inconsistency that results from it. Just like address verification probes reuse the Postfix delivery mechanisms, address validation should reuse those mechanisms, too. Otherwise we would just be moving code duplication around to other places in Postfix, and that is no progress. Wietse