diff options
Diffstat (limited to 'usr.sbin/smtpd/mta.c')
-rw-r--r-- | usr.sbin/smtpd/mta.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index c727307ecd6..26d83c3833e 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.114 2011/10/09 18:39:53 eric Exp $ */ +/* $OpenBSD: mta.c,v 1.115 2011/10/23 09:30:07 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -136,11 +136,11 @@ mta_imsg(struct imsgev *iev, struct imsg *imsg) if (e == NULL) fatal(NULL); *e = *(struct envelope *)imsg->data; - strlcpy(e->delivery.errorline, "000 init", - sizeof(e->delivery.errorline)); + strlcpy(e->errorline, "000 init", + sizeof(e->errorline)); if (s->host == NULL) { - s->host = strdup(e->delivery.rcpt.domain); + s->host = strdup(e->dest.domain); if (s->host == NULL) fatal("strdup"); } @@ -480,16 +480,16 @@ mta_enter_state(struct mta_session *s, int newstate, void *p) /* set envelope sender */ e = TAILQ_FIRST(&s->recipients); - if (e->delivery.from.user[0] && e->delivery.from.domain[0]) - client_sender(pcb, "%s@%s", e->delivery.from.user, - e->delivery.from.domain); + if (e->sender.user[0] && e->sender.domain[0]) + client_sender(pcb, "%s@%s", e->sender.user, + e->sender.domain); else client_sender(pcb, ""); /* set envelope recipients */ TAILQ_FOREACH(e, &s->recipients, entry) - client_rcpt(pcb, e, "%s@%s", e->delivery.rcpt.user, - e->delivery.rcpt.domain); + client_rcpt(pcb, e, "%s@%s", e->dest.user, + e->dest.domain); s->pcb = pcb; event_set(&s->ev, s->fd, EV_READ|EV_WRITE, mta_event, s); @@ -684,25 +684,25 @@ mta_message_status(struct envelope *e, char *status) * higher status (eg. 5yz is of higher status than 4yz), so check * this before deciding to overwrite existing status with a new one. */ - if (*status != '2' && strncmp(e->delivery.errorline, status, 3) > 0) + if (*status != '2' && strncmp(e->errorline, status, 3) > 0) return; /* change status */ - log_debug("mta: new status for %s@%s: %s", e->delivery.rcpt.user, - e->delivery.rcpt.domain, status); - strlcpy(e->delivery.errorline, status, sizeof(e->delivery.errorline)); + log_debug("mta: new status for %s@%s: %s", e->dest.user, + e->dest.domain, status); + strlcpy(e->errorline, status, sizeof(e->errorline)); } static void mta_message_log(struct mta_session *s, struct envelope *e) { struct mta_relay *relay = TAILQ_FIRST(&s->relays); - char *status = e->delivery.errorline; + char *status = e->errorline; log_info("%016llx: to=<%s@%s>, delay=%lld, relay=%s [%s], stat=%s (%s)", - e->delivery.id, e->delivery.rcpt.user, - e->delivery.rcpt.domain, - (long long int) (time(NULL) - e->delivery.creation), + e->id, e->dest.user, + e->dest.domain, + (long long int) (time(NULL) - e->creation), relay ? relay->fqdn : "(none)", relay ? ss_to_text(&relay->sa) : "", *status == '2' ? "Sent" : @@ -714,16 +714,16 @@ mta_message_log(struct mta_session *s, struct envelope *e) static void mta_message_done(struct mta_session *s, struct envelope *e) { - switch (e->delivery.errorline[0]) { + switch (e->errorline[0]) { case '6': case '5': - e->delivery.status = DS_PERMFAILURE; + e->status = DS_PERMFAILURE; break; case '2': - e->delivery.status = DS_ACCEPTED; + e->status = DS_ACCEPTED; break; default: - e->delivery.status = DS_TEMPFAILURE; + e->status = DS_TEMPFAILURE; break; } imsg_compose_event(env->sc_ievs[PROC_QUEUE], @@ -747,7 +747,7 @@ mta_request_datafd(struct mta_session *s) e = TAILQ_FIRST(&s->recipients); rq_batch.b_id = s->id; - rq_batch.msgid = evpid_to_msgid(e->delivery.id); + rq_batch.msgid = evpid_to_msgid(e->id); imsg_compose_event(env->sc_ievs[PROC_QUEUE], IMSG_QUEUE_MESSAGE_FD, 0, 0, -1, &rq_batch, sizeof(rq_batch)); } |