+ if (!ok) {
+ return false;
+ }
+ if (!filter_check_safety(&config->filters)) {
+ return false;
+ }
+
+ ok = false;
+#define PARSE_CHECK(Expr, Fmt, ...) \
+ if (!(Expr)) { \
+ syslog(LOG_ERR, Fmt, ##__VA_ARGS__); \
+ return false; \
+ }
+ foreach (filter_param_t *param, config->params) {
+ switch (param->type) {
+#define CASE(Param, State) \
+ case ATK_ ## Param ## _FILTER: \
+ ok = true; \
+ config->entry_points[SMTP_ ## State] \
+ = filter_find_with_name(&config->filters, param->value); \
+ PARSE_CHECK(config->entry_points[SMTP_ ## State] >= 0, \
+ "invalid filter name %s", param->value); \
+ break;
+ CASE(CLIENT, CONNECT)
+ CASE(EHLO, EHLO)
+ CASE(HELO, HELO)
+ CASE(SENDER, MAIL)
+ CASE(RECIPIENT, RCPT)
+ CASE(DATA, DATA)
+ CASE(END_OF_DATA, END_OF_MESSAGE)
+ CASE(VERIFY, VRFY)
+ CASE(ETRN, ETRN)
+#undef CASE
+ FILTER_PARAM_PARSE_INT(PORT, config->port);
+ default: break;
+ }
+ }}
+ array_deep_wipe(config->params, filter_params_wipe);
+
+ if (!ok) {
+ syslog(LOG_ERR, "no entry point defined");
+ }