summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/aliases.c
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2010-05-31 23:38:57 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2010-05-31 23:38:57 +0000
commitd307483c8c212fa059ff0cd0e59abc3e3d3b2ca3 (patch)
tree39d8b72f5535369d2504027c31822e039f4f731a /usr.sbin/smtpd/aliases.c
parent591293015f3e6c1412e51ad20d7817e6987a652f (diff)
Rewrite entire queue code.
Major goals: 1) Fix bad performance caused by the runner process doing full queue read in 1s intervals. My Soekris can now happily accept >50 msg/s while having multi-thousand queue; before, one hundred queue would bring the system to its knees. 2) Introduce Qmail-like scheduler that doesn't write as much to the disk so that it needs less code for servicing error conditions, which in some places can be tricky to get right. 3) Introduce separation between the scheduler and the backend; these two queue aspects shouldn't be too tied too each other. This means that eg. storing queue in SQL requires rewrite of just queue_backend.c. 4) Make on-disk queue format architecture independent, and more easily extensible, to reduce number of flag days in the future. Minor goals: ENOSPC no longer prevents delivery attempts, fixed session limiting for relayed mail, improved batching of "relay via" mails, human-readable mailq output, "show queue raw" command, clearer logging, sending of single bounce about multiple recipients, exact delay= computation, zero delay between deliveries while within session limit (currently 1s delay between re-scheduling is enforced), mta no longer requests content fd, corrected session limit for bounce submissions, tiny <100B queue files instead of multi-KB, detect loops before accepting mail, reduce traffic on imsg channels by killing enormous struct submit_status.
Diffstat (limited to 'usr.sbin/smtpd/aliases.c')
-rw-r--r--usr.sbin/smtpd/aliases.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c
index 9d7dcb44e49..25c232fb264 100644
--- a/usr.sbin/smtpd/aliases.c
+++ b/usr.sbin/smtpd/aliases.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aliases.c,v 1.33 2010/05/19 20:57:10 gilles Exp $ */
+/* $OpenBSD: aliases.c,v 1.34 2010/05/31 23:38:56 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -67,20 +67,13 @@ aliases_exist(struct smtpd *env, objid_t mapid, char *username)
}
int
-aliases_get(struct smtpd *env, objid_t mapid, struct expandtree *expandtree, char *username)
+aliases_get(struct smtpd *env, objid_t mapid, struct expandtree *tree, char *username)
{
- struct map *map;
struct map_alias *map_alias;
struct expandnode *expnode;
- char buf[MAXLOGNAME];
size_t nbaliases;
- map = map_find(env, mapid);
- if (map == NULL)
- return 0;
-
- lowercase(buf, username, sizeof(buf));
- map_alias = map_lookup(env, mapid, buf, K_ALIAS);
+ map_alias = map_lookup(env, mapid, username, K_ALIAS);
if (map_alias == NULL)
return 0;
@@ -88,9 +81,9 @@ aliases_get(struct smtpd *env, objid_t mapid, struct expandtree *expandtree, cha
nbaliases = 0;
RB_FOREACH(expnode, expandtree, &map_alias->expandtree) {
if (expnode->type == EXPAND_INCLUDE)
- nbaliases += aliases_expand_include(expandtree, expnode->u.filename);
+ nbaliases += aliases_expand_include(tree, expnode->u.filename);
else {
- expandtree_increment_node(expandtree, expnode);
+ expandtree_increment_node(tree, expnode);
nbaliases++;
}
}