summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2011-12-27 14:38:57 +0000
committerEric Faurot <eric@cvs.openbsd.org>2011-12-27 14:38:57 +0000
commit9ca5c2ebe8db67ee84806a9d48060c09107550ad (patch)
treeff817853439b5b94997cd3c50695218b85c97eb9
parent583c8f7853d62565a1dc43139cf3f3ef7f03300c (diff)
Instead of using a separate "bounce" queue, create the bounce envelope
directly as an envelope of the bounced message, just like "regular" envelopes. ok gilles@
-rw-r--r--usr.sbin/smtpd/bounce.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c
index 4cf4be80424..91f9558f1ab 100644
--- a/usr.sbin/smtpd/bounce.c
+++ b/usr.sbin/smtpd/bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bounce.c,v 1.36 2011/12/14 23:08:40 eric Exp $ */
+/* $OpenBSD: bounce.c,v 1.37 2011/12/27 14:38:56 eric Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org>
@@ -184,28 +184,17 @@ rw:
int
bounce_record_message(struct envelope *e, struct envelope *bounce)
{
- u_int32_t msgid;
-
- bzero(bounce, sizeof(*bounce));
-
if (e->type == D_BOUNCE) {
log_debug("mailer daemons loop detected !");
return 0;
}
*bounce = *e;
- bounce->type = D_BOUNCE;
- bounce->status &= ~DS_PERMFAILURE;
-
- msgid = evpid_to_msgid(e->id);
- if (! queue_message_create(Q_BOUNCE, &msgid))
- return 0;
-
- bounce->id = msgid_to_evpid(msgid);
- if (! queue_envelope_create(Q_BOUNCE, bounce))
- return 0;
-
- return queue_message_commit(Q_BOUNCE, msgid);
+ bounce->type = D_BOUNCE;
+ bounce->status &= ~DS_PERMFAILURE;
+ bounce->retry = 0;
+ bounce->lasttry = 0;
+ return (queue_envelope_create(Q_QUEUE, bounce));
}
static void
@@ -215,6 +204,8 @@ queue_message_update(struct envelope *e)
e->status &= ~(DS_ACCEPTED|DS_REJECTED);
e->retry++;
+ if (e->type != D_BOUNCE)
+ fatalx("*** queue_message_update called for non-bounce msg");
if (e->status & DS_PERMFAILURE) {
if (e->type != D_BOUNCE &&