#include "policy_tokens.h"
#include "str.h"
+const char *smtp_state_names[SMTP_count] = {
+ "CONNECT",
+ "HELO",
+ "MAIL",
+ "RCPT",
+ "DATA",
+ "END-OF-MESSAGE",
+ "VRFY",
+ "ETRN",
+};
+
bool query_parse(query_t *query, char *p)
{
#define PARSE_CHECK(expr, error, ...) \
CASE(ETRN_DOMAIN, etrn_domain)
CASE(STRESS, stress)
#undef CASE
+ case PTK_PROTOCOL_NAME:
+ return query->esmtp ? "ESMTP" : "SMTP";
+
+ case PTK_PROTOCOL_STATE:
+ return smtp_state_names[query->state];
+
default: return NULL;
}
}
postlicyd_token tok = policy_tokenize(fmt, next_format - fmt);
if (tok == PTK_UNKNOWN) {
- warn("unknown field name \"%.*s\"", next_format - fmt, fmt);
+ warn("unknown field name \"%.*s\"", (int)(next_format - fmt), fmt);
}
const char *field = query == NULL ? NULL : query_field_for_id(query, tok);
if (field == NULL) {