Proposed PATCH: virtual recipient validation postfix-1.1.11-20020613

(no email)
Date: Mon Jul 01 2002 - 12:26:54 EDT


There are two types of Postfix-style virtual domains. They are
respectively the domains listed in $virtual_maps and the domains listed in
$virtual_mailbox_maps.

The domains listed in $virtual_maps host *no* mailboxes, all valid virtual
addresses in these domains are rewritten to actual addresses in *other*
domains.

The domains listed in $virtual_mailbox_maps host virtual mailboxes
(mailboxes for non-shell users) with a per domain user namespace.
Mail for these domains is intended to be delivered by the "virtual"
delivery agent, but other delivery agents are possible.

The patch below is a minor tweak to how these two types of virtual
recipient are validated.

- The unpatched code checks $virtual_mailbox_maps when validating domains
  in $virtual_maps. This is not correct, because the recipient is
  ultimately rejected by the queue manager (unless the domain is also
  "local", in which case the domain should not be listed in
  $virtual_mailbox_maps have i.e. it should not have a "domain whatever"
  key in $virtual_mailbox_maps).

- The unpatched code checks maps in an order that does not test the most
  probable (IMHO) maps first. The patched code looks in the most likely
  location first. This is an optimization.

There is a related feature that I think should be there, but is not part
of the patch. I think that virtual mailbox domains (domains in
$virtual_mailbox_maps, we need an official term for this...) should
default to the "virtual" transport (actual $virtual_transport, which
defaults to "virtual"). This would mimic the delivery logic for domains in
$mydestination. Without this second feature virtual domains need to be
listed in both $virtual_mailbox_maps and $transport_maps. Comments?

-- 
	Viktor.
Index: src/smtpd/smtpd_check.c
===================================================================
--- smtpd_check.c	2002/06/21 21:02:10	1.1.1.20.4.2
+++ smtpd_check.c	2002/07/01 16:03:01	1.1.1.20.4.3
@@ -2492,11 +2492,10 @@
      */
     if (*var_virtual_maps
 	&& (check_maps_find(state, recipient, virtual_maps, domain, 0))) {
-	if (NOMATCH(rcpt_canon_maps, CONST_STR(reply->recipient))
+	if (NOMATCH(virtual_maps, CONST_STR(reply->recipient))
+	    && NOMATCH(rcpt_canon_maps, CONST_STR(reply->recipient))
 	    && NOMATCH(canonical_maps, CONST_STR(reply->recipient))
-	    && NOMATCH(relocated_maps, CONST_STR(reply->recipient))
-	    && NOMATCH(virt_mailbox_maps, CONST_STR(reply->recipient))
-	    && NOMATCH(virtual_maps, CONST_STR(reply->recipient))) {
+	    && NOMATCH(relocated_maps, CONST_STR(reply->recipient))) {
 	    (void) smtpd_check_reject(state, MAIL_ERROR_BOUNCE,
 				   "%d <%s>: User unknown", 550, recipient);
 	    SMTPD_CHECK_RCPT_RETURN(STR(error_text));
@@ -2508,11 +2507,11 @@
      */
     if (*var_virt_mailbox_maps
      && (check_maps_find(state, recipient, virt_mailbox_maps, domain, 0))) {
-	if (NOMATCH(rcpt_canon_maps, CONST_STR(reply->recipient))
+	if (NOMATCH(virt_mailbox_maps, CONST_STR(reply->recipient))
+	    && NOMATCH(virtual_maps, CONST_STR(reply->recipient))
+	    && NOMATCH(rcpt_canon_maps, CONST_STR(reply->recipient))
 	    && NOMATCH(canonical_maps, CONST_STR(reply->recipient))
-	    && NOMATCH(relocated_maps, CONST_STR(reply->recipient))
-	    && NOMATCH(virt_mailbox_maps, CONST_STR(reply->recipient))
-	    && NOMATCH(virtual_maps, CONST_STR(reply->recipient))) {
+	    && NOMATCH(relocated_maps, CONST_STR(reply->recipient))) {
 	    (void) smtpd_check_reject(state, MAIL_ERROR_BOUNCE,
 				   "%d <%s>: User unknown", 550, recipient);
 	    SMTPD_CHECK_RCPT_RETURN(STR(error_text));
-
To unsubscribe, send mail to  with content
(not subject): unsubscribe postfix-users







Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD