diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2015-11-30 10:56:26 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2015-11-30 10:56:26 +0000 |
commit | 58cd23f8b673bf068b9e90a5f0b96b137a605dcc (patch) | |
tree | c93088d0547c1bcc910dabfb284337e6bada7a46 /usr.sbin/smtpd/lka_session.c | |
parent | 671c17c5b086b6ee31f9205767ebe521bd79f5c5 (diff) |
teach aliases expansion how to deal with user+tag
ok sunil@, ok jung@
Diffstat (limited to 'usr.sbin/smtpd/lka_session.c')
-rw-r--r-- | usr.sbin/smtpd/lka_session.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c index e9ccf447de4..13e409af552 100644 --- a/usr.sbin/smtpd/lka_session.c +++ b/usr.sbin/smtpd/lka_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_session.c,v 1.73 2015/10/28 07:43:44 gilles Exp $ */ +/* $OpenBSD: lka_session.c,v 1.74 2015/11/30 10:56:25 gilles Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -274,6 +274,7 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) struct mailaddr maddr; int r; union lookup lk; + char *tag; if (xn->depth >= EXPAND_DEPTH) { log_trace(TRACE_EXPAND, "expand: lka_expand: node too deep."); @@ -378,6 +379,10 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) break; } + /* gilles+hackers@ -> gilles@ */ + if ((tag = strchr(xn->u.user, TAG_CHAR)) != NULL) + *tag++ = '\0'; + r = table_lookup(rule->r_userbase, NULL, xn->u.user, K_USERINFO, &lk); if (r == -1) { log_trace(TRACE_EXPAND, "expand: lka_expand: " @@ -839,13 +844,7 @@ lka_expand_format(char *buf, size_t len, const struct envelope *ep, static void mailaddr_to_username(const struct mailaddr *maddr, char *dst, size_t len) { - char *tag; - xlowercase(dst, maddr->user, len); - - /* gilles+hackers@ -> gilles@ */ - if ((tag = strchr(dst, TAG_CHAR)) != NULL) - *tag++ = '\0'; } static int |