diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-04-24 08:32:13 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-04-24 08:32:13 +0000 |
commit | 8664ba2022ee21611a72b11fc6643473544f6f17 (patch) | |
tree | aaead57a65f6fc4d39b59d67cfb3fb32ec6021a5 /usr.sbin | |
parent | 9c11046f03bacd69a22601921ef58e8a88c3feb9 (diff) |
kill unnecessary struct message_recipient; ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/mfa.c | 17 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 16 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 10 |
3 files changed, 13 insertions, 30 deletions
diff --git a/usr.sbin/smtpd/mfa.c b/usr.sbin/smtpd/mfa.c index 348dbba4e4e..97c61e1e485 100644 --- a/usr.sbin/smtpd/mfa.c +++ b/usr.sbin/smtpd/mfa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfa.c,v 1.20 2009/04/21 14:37:32 eric Exp $ */ +/* $OpenBSD: mfa.c,v 1.21 2009/04/24 08:32:12 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -48,7 +48,7 @@ void mfa_disable_events(struct smtpd *); void mfa_timeout(int, short, void *); void mfa_test_mail(struct smtpd *, struct message *); -void mfa_test_rcpt(struct smtpd *, struct message_recipient *); +void mfa_test_rcpt(struct smtpd *, struct message *); int mfa_ruletest_rcpt(struct smtpd *, struct path *, struct sockaddr_storage *); int mfa_check_source(struct map *, struct sockaddr_storage *); int mfa_match_mask(struct sockaddr_storage *, struct netaddr *); @@ -426,17 +426,16 @@ accept: } void -mfa_test_rcpt(struct smtpd *env, struct message_recipient *mr) +mfa_test_rcpt(struct smtpd *env, struct message *m) { struct submit_status ss; - ss.id = mr->id; + ss.id = m->session_id; ss.code = 530; - ss.u.path = mr->path; - ss.ss = mr->ss; - ss.msg = mr->msg; - - ss.flags = mr->flags; + ss.u.path = m->session_rcpt; + ss.ss = m->session_ss; + ss.msg = *m; + ss.flags = m->flags; strip_source_route(ss.u.path.user, sizeof(ss.u.path.user)); diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index c0b7076a9a9..4b456c5479f 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.70 2009/04/20 18:48:23 jacekm Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.71 2009/04/24 08:32:12 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -418,7 +418,6 @@ int session_rfc5321_rcpt_handler(struct session *s, char *args) { char buffer[MAX_PATH_SIZE]; - struct message_recipient mr; if (s->s_state == S_GREETED) { session_respond(s, "503 Polite people say HELO first"); @@ -430,33 +429,26 @@ session_rfc5321_rcpt_handler(struct session *s, char *args) return 1; } - bzero(&mr, sizeof(mr)); - if (strlcpy(buffer, args, sizeof(buffer)) >= sizeof(buffer)) { session_respond(s, "553 Recipient address syntax error"); return 1; } - if (! session_set_path(&mr.path, buffer)) { + if (! session_set_path(&s->s_msg.session_rcpt, buffer)) { /* No need to even transmit to MFA, path is invalid */ session_respond(s, "553 Recipient address syntax error"); return 1; } - s->s_msg.session_rcpt = mr.path; - - mr.id = s->s_msg.id; s->s_state = S_RCPTREQUEST; - mr.ss = s->s_ss; - mr.msg = s->s_msg; if (s->s_flags & F_AUTHENTICATED) { s->s_msg.flags |= F_MESSAGE_AUTHENTICATED; - mr.flags |= F_MESSAGE_AUTHENTICATED; } - session_imsg(s, PROC_MFA, IMSG_MFA_RCPT, 0, 0, -1, &mr, sizeof(mr)); + session_imsg(s, PROC_MFA, IMSG_MFA_RCPT, 0, 0, -1, &s->s_msg, + sizeof(s->s_msg)); return 1; } diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 15e69dc586a..de84519e215 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.101 2009/04/21 18:12:05 jacekm Exp $ */ +/* $OpenBSD: smtpd.h,v 1.102 2009/04/24 08:32:12 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -711,14 +711,6 @@ struct submit_status { struct message msg; }; -struct message_recipient { - u_int64_t id; - struct sockaddr_storage ss; - enum message_flags flags; - struct path path; - struct message msg; -}; - struct forward_req { u_int64_t id; u_int8_t status; |