summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/forward.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-01-07 00:26:31 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-01-07 00:26:31 +0000
commit6a6816a1f3e5d7de10de80d1dcaf5cf964f400ba (patch)
treeef72e6c36aaa69ec73225265935590a73a02c029 /usr.sbin/smtpd/forward.c
parent4d7169faddcbb9191d6921755ec0f97468b0bf7b (diff)
- when performing aliases expansion, do not forget to set an action to each
expanded envelope, orelse they will use the default action and be passed to MTA no matter if recipient is local or not. bug reported by Nicholas Marriott <nicholas.marriott@gmail.com>, fixed by me and okayd by jacekm@, collaborative work ;-)
Diffstat (limited to 'usr.sbin/smtpd/forward.c')
-rw-r--r--usr.sbin/smtpd/forward.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/forward.c b/usr.sbin/smtpd/forward.c
index 7613f729940..146e3333d9c 100644
--- a/usr.sbin/smtpd/forward.c
+++ b/usr.sbin/smtpd/forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: forward.c,v 1.8 2009/01/04 00:58:59 gilles Exp $ */
+/* $OpenBSD: forward.c,v 1.9 2009/01/07 00:26:30 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -45,6 +45,7 @@ forwards_get(struct aliaseslist *aliases, char *username)
size_t len;
struct stat sb;
struct passwd *pw;
+ size_t nbaliases = 0;
pw = getpwnam(username);
if (pw == NULL)
@@ -99,11 +100,12 @@ forwards_get(struct aliaseslist *aliases, char *username)
fatal("calloc");
*aliasp = alias;
TAILQ_INSERT_HEAD(aliases, aliasp, entry);
+ nbaliases++;
}
free(lbuf);
fclose(fp);
- return 1;
+ return nbaliases;
bad:
log_debug("+ forward file error, probably bad perms/mode");