diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2019-07-11 21:40:04 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2019-07-11 21:40:04 +0000 |
commit | 164b2a5660b86c080db08864dd8b774a49b6401b (patch) | |
tree | 10fc43d0348b8e18dd11ef4fb9379fb139ad701d /usr.sbin/smtpd/lka.c | |
parent | d7eb237984124717cb06653a95b1d87a36633649 (diff) |
introduce link-auth to the smtp reporting stream so that filters may know
if a link has been authenticated successfully or not and for which user
Diffstat (limited to 'usr.sbin/smtpd/lka.c')
-rw-r--r-- | usr.sbin/smtpd/lka.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 2d8d29ef204..0911b9c4751 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.237 2019/07/11 21:04:59 gilles Exp $ */ +/* $OpenBSD: lka.c,v 1.238 2019/07/11 21:40:03 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -80,12 +80,14 @@ lka_imsg(struct mproc *p, struct imsg *imsg) struct timeval tv; const char *direction; const char *rdns; - const char *command, *response; + const char *command; + const char *response; const char *ciphers; const char *address; const char *helomethod; const char *heloname; const char *filter_name; + const char *result; struct sockaddr_storage ss_src, ss_dest; int filter_response; int filter_phase; @@ -434,6 +436,18 @@ lka_imsg(struct mproc *p, struct imsg *imsg) lka_report_smtp_link_reset(direction, &tv, reqid); return; + case IMSG_REPORT_SMTP_LINK_AUTH: + m_msg(&m, imsg); + m_get_string(&m, &direction); + m_get_timeval(&m, &tv); + m_get_id(&m, &reqid); + m_get_string(&m, &username); + m_get_string(&m, &result); + m_end(&m); + + lka_report_smtp_link_auth(direction, &tv, reqid, username, result); + return; + case IMSG_REPORT_SMTP_TX_BEGIN: m_msg(&m, imsg); m_get_string(&m, &direction); |