summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/forward.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-01-04 00:59:00 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-01-04 00:59:00 +0000
commit65d5eea4d2d2eea990e0af85286c7ffc76999b7a (patch)
tree5b818dd066767fb7b845263e7343a0f80bca9a9b /usr.sbin/smtpd/forward.c
parent40a5535f8935f28641c54bc1be8601c57346cad6 (diff)
aliases/forwards expansion was not done correctly and a race could
cause delivery to happen before expansion is over, causing some of the recipients to never receive the mail. change how the mfa, lka, queue and smtp processes communicate to ensure smtp never receives an acknowledgment before ALL expanded envelopes are on disk. While at it, lka was doing work which belongs in mfa, fix that also. this is based on an idea from a talk with jacekm@, change not over but already better than what we had.
Diffstat (limited to 'usr.sbin/smtpd/forward.c')
-rw-r--r--usr.sbin/smtpd/forward.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/forward.c b/usr.sbin/smtpd/forward.c
index 8289d9678cf..7613f729940 100644
--- a/usr.sbin/smtpd/forward.c
+++ b/usr.sbin/smtpd/forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: forward.c,v 1.7 2009/01/01 16:15:47 jacekm Exp $ */
+/* $OpenBSD: forward.c,v 1.8 2009/01/04 00:58:59 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "smtpd.h"
@@ -40,10 +41,10 @@ forwards_get(struct aliaseslist *aliases, char *username)
struct alias alias;
struct alias *aliasp;
char pathname[MAXPATHLEN];
- struct passwd *pw;
char *buf, *lbuf;
size_t len;
struct stat sb;
+ struct passwd *pw;
pw = getpwnam(username);
if (pw == NULL)