summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtp.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2011-10-23 09:30:08 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2011-10-23 09:30:08 +0000
commite3cfbeb71221f3f3bee3fcbfef00515742b2db32 (patch)
treeb6982699bd3a5aa673680f516988242d259225b7 /usr.sbin/smtpd/smtp.c
parent436e188d636566b43d727d0356572ecdff1c87d9 (diff)
fsqueue no longer stores envelopes by dumping the structure, instead use a
couple of load/dump functions to convert to and from a human readable fmt. while at it kill struct delivery and merge back its fields to the envelope. this basically means we shouldn't require users to flush their queues every time we make a change to struct envelope. work is not done, but we're at a better state than the binary fsqueue so we'll improve it in-tree. has been running on my own box for the last 12 hours or so ok eric@, chl@
Diffstat (limited to 'usr.sbin/smtpd/smtp.c')
-rw-r--r--usr.sbin/smtpd/smtp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c
index 8ea6d9465ec..b3d9e9a21e5 100644
--- a/usr.sbin/smtpd/smtp.c
+++ b/usr.sbin/smtpd/smtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp.c,v 1.92 2011/10/09 18:39:54 eric Exp $ */
+/* $OpenBSD: smtp.c,v 1.93 2011/10/23 09:30:07 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -73,8 +73,8 @@ smtp_imsg(struct imsgev *iev, struct imsg *imsg)
strlcpy(s->s_hostname,
dns->error ? "<unknown>" : dns->host,
sizeof s->s_hostname);
- strlcpy(s->s_msg.delivery.hostname, s->s_hostname,
- sizeof s->s_msg.delivery.hostname);
+ strlcpy(s->s_msg.hostname, s->s_hostname,
+ sizeof s->s_msg.hostname);
session_init(s->s_l, s);
return;
}
@@ -103,7 +103,7 @@ smtp_imsg(struct imsgev *iev, struct imsg *imsg)
s = session_lookup(ss->id);
if (s == NULL)
return;
- s->s_msg.delivery.id = (u_int64_t)ss->u.msgid << 32;
+ s->s_msg.id = ((u_int64_t)ss->u.msgid) << 32;
session_pickup(s, ss);
return;
@@ -130,7 +130,7 @@ smtp_imsg(struct imsgev *iev, struct imsg *imsg)
fatalx("smtp: session is gone");
if (s->s_flags & F_WRITEONLY)
/* session is write-only, must not destroy it. */
- s->s_msg.delivery.status |= DS_TEMPFAILURE;
+ s->s_msg.status |= DS_TEMPFAILURE;
else
fatalx("smtp: corrupt session");
return;
@@ -167,7 +167,7 @@ smtp_imsg(struct imsgev *iev, struct imsg *imsg)
*/
SPLAY_FOREACH(s, sessiontree, &env->sc_sessions) {
s->s_l = NULL;
- s->s_msg.delivery.status |= DS_TEMPFAILURE;
+ s->s_msg.status |= DS_TEMPFAILURE;
}
if (env->sc_listeners)
smtp_disable_events();
@@ -247,10 +247,10 @@ smtp_imsg(struct imsgev *iev, struct imsg *imsg)
return;
if (auth->success) {
s->s_flags |= F_AUTHENTICATED;
- s->s_msg.delivery.flags |= DF_AUTHENTICATED;
+ s->s_msg.flags |= DF_AUTHENTICATED;
} else {
s->s_flags &= ~F_AUTHENTICATED;
- s->s_msg.delivery.flags &= ~DF_AUTHENTICATED;
+ s->s_msg.flags &= ~DF_AUTHENTICATED;
}
session_pickup(s, NULL);
return;
@@ -478,18 +478,18 @@ smtp_enqueue(uid_t *euid)
s->s_fd = fd[0];
s->s_ss = sa;
- s->s_msg.delivery.flags |= DF_ENQUEUED;
+ s->s_msg.flags |= DF_ENQUEUED;
if (euid)
bsnprintf(s->s_hostname, sizeof(s->s_hostname), "%d@localhost",
*euid);
else {
strlcpy(s->s_hostname, "localhost", sizeof(s->s_hostname));
- s->s_msg.delivery.flags |= DF_BOUNCE;
+ s->s_msg.flags |= DF_BOUNCE;
}
- strlcpy(s->s_msg.delivery.hostname, s->s_hostname,
- sizeof(s->s_msg.delivery.hostname));
+ strlcpy(s->s_msg.hostname, s->s_hostname,
+ sizeof(s->s_msg.hostname));
session_init(l, s);