summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/bounce.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2011-05-16 21:05:53 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2011-05-16 21:05:53 +0000
commit5e214bf2f9e80611a8b62614bf245d0b6df10679 (patch)
tree902c5b4dfdb9664269ef442febf2685a0af86442 /usr.sbin/smtpd/bounce.c
parentad8f46c8f3c15f2ba7e47cdbdc8495a754b0bff9 (diff)
murder struct path and make sure smtpd uses simpler structures that do not
bring a shitload of unnecessary information everywhere. this required many parts of smtpd to be refactored and more specifically envelope expansion. in the process lots of code got simplified, and the envelope expansion code has been isolated to lka_session.c with some longstanding bugs fixed. Diff has been tested by many with no major regression reported. armani@ spotted a bug in a setup where a domain is listed a both primary and virtual, I will fix that in-tree as it's becoming painful to maintain this diff out.
Diffstat (limited to 'usr.sbin/smtpd/bounce.c')
-rw-r--r--usr.sbin/smtpd/bounce.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c
index ff3bed8100b..9ad1b7130b8 100644
--- a/usr.sbin/smtpd/bounce.c
+++ b/usr.sbin/smtpd/bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bounce.c,v 1.31 2011/05/01 12:57:11 eric Exp $ */
+/* $OpenBSD: bounce.c,v 1.32 2011/05/16 21:05:51 gilles Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org>
@@ -54,7 +54,7 @@ bounce_session(int fd, struct envelope *m)
FILE *msgfp = NULL;
u_int32_t msgid;
- msgid = evpid_to_msgid(m->evpid);
+ msgid = evpid_to_msgid(m->delivery.id);
/* get message content */
if ((msgfd = queue_message_fd_r(Q_QUEUE, msgid)) == -1)
@@ -72,11 +72,11 @@ bounce_session(int fd, struct envelope *m)
client_ssl_optional(cc->pcb);
client_sender(cc->pcb, "");
- client_rcpt(cc->pcb, NULL, "%s@%s", m->sender.user,
- m->sender.domain);
+ client_rcpt(cc->pcb, NULL, "%s@%s", m->delivery.from.user,
+ m->delivery.from.domain);
/* Construct an appropriate reason line. */
- reason = m->session_errorline;
+ reason = m->delivery.errorline;
if (strlen(reason) > 4 && (*reason == '1' || *reason == '6'))
reason += 4;
@@ -100,9 +100,9 @@ bounce_session(int fd, struct envelope *m)
"Below is a copy of the original message:\n"
"\n",
env->sc_hostname,
- m->sender.user, m->sender.domain,
+ m->delivery.from.user, m->delivery.from.domain,
time_to_text(time(NULL)),
- m->recipient.user, m->recipient.domain,
+ m->delivery.rcpt.user, m->delivery.rcpt.domain,
reason);
/* setup event */
@@ -151,10 +151,10 @@ out:
queue_envelope_delete(Q_QUEUE, &cc->m);
else {
if (*ep == '5' || *ep == '6')
- cc->m.status = S_MESSAGE_PERMFAILURE;
+ cc->m.delivery.status = DS_PERMFAILURE;
else
- cc->m.status = S_MESSAGE_TEMPFAILURE;
- message_set_errormsg(&cc->m, "%s", ep);
+ cc->m.delivery.status = DS_TEMPFAILURE;
+ envelope_set_errormsg(&cc->m, "%s", ep);
queue_message_update(&cc->m);
}