diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2010-10-09 22:05:37 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2010-10-09 22:05:37 +0000 |
commit | d03e820a64c086ef91e09c750ee5f63d0f92bd91 (patch) | |
tree | bcd99e0369bf56dd3644d511c4739e776aae750e /usr.sbin/smtpd/aliases.c | |
parent | 958e6885331439b7376f5709ed38bd3ee6dd55d7 (diff) |
backout the "new" queue code commited 4 months ago. it has many good ideas,
is way more optimized than what we had earlier and there's definitely stuff
we want to keep, however it is early optimization that doesn't account for
many features and makes them hard (if not impossible) to write without
ugly workarounds that ruin the purpose of the optimizations.
the backout goes to 30 May's right before the commit and catches up on all
the non-queue related commits that happened since then.
i'll work on reintroducing the ideas from this queue when the basic
features we expect from a MTA are implemented.
suggested on tech@ about a week ago, no objections, several "please make
smtpd move forward" mails from hackers and tech readers.
Diffstat (limited to 'usr.sbin/smtpd/aliases.c')
-rw-r--r-- | usr.sbin/smtpd/aliases.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c index 9a69d927827..7c0410318dd 100644 --- a/usr.sbin/smtpd/aliases.c +++ b/usr.sbin/smtpd/aliases.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aliases.c,v 1.36 2010/06/01 23:06:23 jacekm Exp $ */ +/* $OpenBSD: aliases.c,v 1.37 2010/10/09 22:05:35 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -67,13 +67,20 @@ aliases_exist(struct smtpd *env, objid_t mapid, char *username) } int -aliases_get(struct smtpd *env, objid_t mapid, struct expandtree *tree, char *username) +aliases_get(struct smtpd *env, objid_t mapid, struct expandtree *expandtree, char *username) { + struct map *map; struct map_alias *map_alias; struct expandnode *expnode; + char buf[MAXLOGNAME]; size_t nbaliases; - map_alias = map_lookup(env, mapid, username, K_ALIAS); + map = map_find(env, mapid); + if (map == NULL) + return 0; + + lowercase(buf, username, sizeof(buf)); + map_alias = map_lookup(env, mapid, buf, K_ALIAS); if (map_alias == NULL) return 0; @@ -81,9 +88,9 @@ aliases_get(struct smtpd *env, objid_t mapid, struct expandtree *tree, char *use nbaliases = 0; RB_FOREACH(expnode, expandtree, &map_alias->expandtree) { if (expnode->type == EXPAND_INCLUDE) - nbaliases += aliases_expand_include(tree, expnode->u.filename); + nbaliases += aliases_expand_include(expandtree, expnode->u.filename); else { - expandtree_increment_node(tree, expnode); + expandtree_increment_node(expandtree, expnode); nbaliases++; } } |