summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-11-09 22:28:09 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-11-09 22:28:09 +0000
commit6806ee378011e2764662a9d508e71e773fdb50f1 (patch)
tree5d32a6a41f9f6c5174d845e91cfa70aa95e34ce1 /usr.sbin/smtpd
parent5f1614daeee12769a462099bcd8de9f42c8af4a1 (diff)
support the userpart+foobar@domainpart syntax which got wiped when i wrote
the virtual domains support as it was in my way. this time, make it work as it should: userpart+foobar@domainpart becomes: path->user = userpart+foobar path->domain = domainpart path->pw_name = userpart discussed quickly with jacekm@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/lka.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c
index 71849263256..e49642e648f 100644
--- a/usr.sbin/smtpd/lka.c
+++ b/usr.sbin/smtpd/lka.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka.c,v 1.83 2009/11/08 23:08:56 gilles Exp $ */
+/* $OpenBSD: lka.c,v 1.84 2009/11/09 22:28:08 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -1014,10 +1014,15 @@ lka_resolve_path(struct smtpd *env, struct lkasession *lkasession, struct path *
case C_NET:
case C_DOM: {
char username[MAXLOGNAME];
+ char *sep;
struct passwd *pw;
lowercase(username, path->user, sizeof(username));
+ sep = strchr(username, '+');
+ if (sep != NULL)
+ *sep = '\0';
+
if (aliases_exist(env, path->rule.r_amap, username)) {
path->flags |= F_PATH_ALIAS;
return 1;