PUSH_NOTIFICATION_MESSAGE_HDR_FROM | PUSH_NOTIFICATION_MESSAGE_HDR_TO | \
PUSH_NOTIFICATION_MESSAGE_HDR_SUBJECT | PUSH_NOTIFICATION_MESSAGE_HDR_DATE | \
PUSH_NOTIFICATION_MESSAGE_BODY_SNIPPET | PUSH_NOTIFICATION_MESSAGE_FLAGS | \
- PUSH_NOTIFICATION_MESSAGE_KEYWORDS)
+ PUSH_NOTIFICATION_MESSAGE_KEYWORDS | PUSH_NOTIFICATION_MESSAGE_HDR_MESSAGE_ID)
static const char *push_notification_driver_lua_to_fn(const char *evname);
dlua_pushkeywords(script, data->keywords, str_array_length(data->keywords));
lua_setfield(script->L, -2, "keywords");
+
+ lua_pushstring(script->L, data->message_id);
+ lua_setfield(script->L, -2, "message_id");
}
static void
dlua_pushkeywords(script, data->keywords, str_array_length(data->keywords));
lua_setfield(script->L, -2, "keywords");
+
+ lua_pushstring(script->L, data->message_id);
+ lua_setfield(script->L, -2, "message_id");
}
/* events that need special treatment */
PUSH_NOTIFICATION_MESSAGE_FLAGS = 0x20,
/* Meta: Keywords */
PUSH_NOTIFICATION_MESSAGE_KEYWORDS = 0x40,
+ /* Header: Message-ID */
+ PUSH_NOTIFICATION_MESSAGE_HDR_MESSAGE_ID = 0x80,
};
array_append_zero(&kws);
data->keywords = array_idx(&kws, 0);
}
+
+ if ((data->message_id == NULL) &&
+ (config->flags & PUSH_NOTIFICATION_MESSAGE_HDR_MESSAGE_ID) != 0 &&
+ (mail_get_first_header(mail, "Message-ID", &value) >= 0)) {
+ data->message_id = p_strdup(ptxn->pool, value);
+ }
}
array_append_zero(&kws);
data->keywords = array_idx(&kws, 0);
}
+
+ if ((data->message_id == NULL) &&
+ (config->flags & PUSH_NOTIFICATION_MESSAGE_HDR_MESSAGE_ID) != 0 &&
+ (mail_get_first_header(mail, "Message-ID", &value) >= 0)) {
+ data->message_id = p_strdup(ptxn->pool, value);
+ }
}