diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2011-09-12 20:47:16 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2011-09-12 20:47:16 +0000 |
commit | f08fc97c4874b50e4e253344604bd7728be4698a (patch) | |
tree | d67e5e3a1b4c259aabf3d1e5f4bc38ea512fa58e /usr.sbin/smtpd/smtp_session.c | |
parent | c903dba584a1bf805485236c727a87eac6208170 (diff) |
- introduce filtermask in struct smtpd
- do not forward lines to mfa when FILTER_DATALINE is not set in filtermask
prevents smtpd from handling mails slowly while I'm hacking on filters
support
Diffstat (limited to 'usr.sbin/smtpd/smtp_session.c')
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 32ba1db59ac..4790e625df0 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.146 2011/09/01 19:56:49 eric Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.147 2011/09/12 20:47:15 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -820,12 +820,16 @@ session_read(struct bufferevent *bev, void *p) if (strlcpy(ss.u.dataline, line, sizeof(ss.u.dataline)) >= sizeof(ss.u.dataline)) fatal("session_read: data truncation"); - - session_imsg(s, PROC_MFA, IMSG_MFA_DATALINE, - 0, 0, -1, &ss, sizeof(ss)); - free(line); + if (env->filtermask & FILTER_DATALINE) + session_imsg(s, PROC_MFA, IMSG_MFA_DATALINE, + 0, 0, -1, &ss, sizeof(ss)); + else { + log_debug("no filter"); + ss.code = 250; + session_pickup(s, &ss); + } return; } |