aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c18
1 files changed, 15 insertions, 3 deletions
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++;
}
}