+ vtk = tokenize(v, vlen);
+ switch (tokenize(k, klen)) {
+#define CASE(up, low) case PTK_##up: query->low = v; v[vlen] = '\0'; break;
+ CASE(HELO_NAME, helo_name);
+ CASE(QUEUE_ID, queue_id);
+ CASE(SENDER, sender);
+ CASE(RECIPIENT, recipient);
+ CASE(RECIPIENT_COUNT, recipient_count);
+ CASE(CLIENT_ADDRESS, client_address);
+ CASE(CLIENT_NAME, client_name);
+ CASE(RCLIENT_NAME, rclient_name);
+ CASE(INSTANCE, instance);
+ CASE(SASL_METHOD, sasl_method);
+ CASE(SASL_USERNAME, sasl_username);
+ CASE(SASL_SENDER, sasl_sender);
+ CASE(SIZE, size);
+ CASE(CCERT_SUBJECT, ccert_subject);
+ CASE(CCERT_ISSUER, ccert_issuer);
+ CASE(CCSERT_FINGERPRINT, ccsert_fingerprint);
+ CASE(ENCRYPTION_PROTOCOL, encryption_protocol);
+ CASE(ENCRYPTION_CIPHER, encryption_cipher);
+ CASE(ENCRYPTION_KEYSIZE, encryption_keysize);
+ CASE(ETRN_DOMAIN, etrn_domain);
+#undef CASE
+
+ case PTK_REQUEST:
+ PARSE_CHECK(vtk == PTK_SMTPD_ACCESS_POLICY,
+ "unexpected `request' value: %.*s", vlen, v);
+ break;
+
+ case PTK_PROTOCOL_NAME:
+ PARSE_CHECK(vtk == PTK_SMTP || vtk == PTK_ESMTP,
+ "unexpected `protocol_name' value: %.*s", vlen, v);
+ query->esmtp = vtk == PTK_ESMTP;
+ break;