From b5ce06b90ea4283596a70458d72b474bcc9d24da Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 2 Oct 1997 03:06:13 +0000 Subject: Lica Olivetti's qvirtual option. svn path=/trunk/; revision=1465 --- driver.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 9fd9aeaa..926af3c1 100644 --- a/driver.c +++ b/driver.c @@ -222,16 +222,28 @@ struct query *ctl; /* list of permissible aliases */ struct idlist **xmit_names; /* list of recipient names parsed out */ { const char *lname; - + int sl; + int off = 0; + lname = idpair_find(&ctl->localnames, name); if (!lname && ctl->wildcard) lname = name; if (lname != (char *)NULL) { + /* + * If the name of the user begins with a + * qmail virtual domain prefix, remove + * the prefix + */ + if (ctl->server.qvirtual) + { + sl=strlen(ctl->server.qvirtual); + if (!strncasecmp(lname,ctl->server.qvirtual,sl)) off=sl; + } if (outlevel == O_VERBOSE) - error(0, 0, "mapped %s to local %s", name, lname); - save_str(xmit_names, XMIT_ACCEPT, lname); + error(0, 0, "mapped %s to local %s", name, lname+off); + save_str(xmit_names, XMIT_ACCEPT, lname+off); accept_count++; } } -- cgit v1.2.3