The included patch allows smtpd/filter_api.c to compile. I know it's
not hooked in yet. I am working on adding dnsbl. I have a patch
under test which is integrated into the body of smtpd. It would be
cleaner if it could be an external filter. Is anybody working on
the filter code? Would it be possible to get hints about how
the filter api code should hook into the body of smtpd.
Otherwise I'll just install sendmail & let this go for now.
Index: filter_api.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/filter_api.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 filter_api.c
--- filter_api.c 20 Jan 2015 17:37:54 -0000 1.16
+++ filter_api.c 15 Aug 2015 09:42:38 -0000
@@ -18,8 +18,10 @@
*/
#include <sys/types.h>
+#include <sys/tree.h>
#include <sys/queue.h>
#include <sys/uio.h>
+#include <sys/socket.h>
#include <event.h>
#include <fcntl.h>
@@ -30,6 +32,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <netdb.h>
+#include <limits.h>
#include "smtpd.h"
#include "log.h"
@@ -115,9 +119,13 @@ static void filter_trigger_eom(struct fi
static void filter_io_in(struct io *, int);
static void filter_io_out(struct io *, int);
static const char *filterimsg_to_str(int);
+#if 0 /* unused, left because purpose unknown */
static const char *hook_to_str(int);
+#endif
static const char *query_to_str(int);
+#if 0 /* unused, left because purpose unknown */
static const char *event_to_str(int);
+#endif
static void
@@ -180,7 +188,7 @@ filter_dispatch(struct mproc *p, struct
const char *line, *name;
uint32_t v, datalen;
uint64_t id, qid;
- int status, type;
+ int type;
int fds[2], fdin, fdout;
log_trace(TRACE_FILTERS, "filter-api:%s imsg %s", filter_name,
@@ -610,6 +618,7 @@ filterimsg_to_str(int imsg)
}
}
+#if 0 /* unused, left because purpose unknown */
static const char *
hook_to_str(int hook)
{
@@ -629,6 +638,7 @@ hook_to_str(int hook)
return ("HOOK_???");
}
}
+#endif
static const char *
query_to_str(int query)
@@ -646,6 +656,7 @@ query_to_str(int query)
}
}
+#if 0 /* unused, left because purpose unknown */
static const char *
event_to_str(int event)
{
@@ -659,6 +670,7 @@ event_to_str(int event)
return ("EVENT_???");
}
}
+#endif
/*
* These functions are called from mproc.c