npart->raw_headers_str,
npart->raw_headers_len,
FALSE);
+
+ /* Preserve the natural order */
+ if (npart->headers_order) {
+ LL_REVERSE2 (npart->headers_order, ord_next);
+ }
}
hdr = rspamd_message_get_header_from_hash (npart->raw_headers,
TRUE);
npart->raw_headers = rspamd_message_headers_ref (
MESSAGE_FIELD (task, raw_headers));
+
+ /* Preserve the natural order */
+ if (MESSAGE_FIELD (task, headers_order)) {
+ LL_REVERSE2 (MESSAGE_FIELD (task, headers_order), ord_next);
+ }
}
hdr = rspamd_message_get_header_from_hash (
TRUE);
npart->raw_headers = rspamd_message_headers_ref (
MESSAGE_FIELD (task, raw_headers));
+
+ /* Preserve the natural order */
+ if (MESSAGE_FIELD (task, headers_order)) {
+ LL_REVERSE2 (MESSAGE_FIELD (task, headers_order), ord_next);
+ }
}
hdr = rspamd_message_get_header_from_hash (
npart->raw_headers_str,
npart->raw_headers_len,
FALSE);
+
+ /* Preserve the natural order */
+ if (npart->headers_order) {
+ LL_REVERSE2 (npart->headers_order, ord_next);
+ }
}
hdr = rspamd_message_get_header_from_hash (npart->raw_headers,
if (part->headers_order) {
hdr = part->headers_order;
- LL_FOREACH (hdr, cur) {
+ LL_FOREACH2 (hdr, cur, ord_next) {
if (re && re->re) {
if (!rspamd_regexp_match (re->re, cur->name,
strlen (cur->name),FALSE)) {
if (MESSAGE_FIELD (task, headers_order)) {
hdr = MESSAGE_FIELD (task, headers_order);
- LL_FOREACH (hdr, cur) {
+ LL_FOREACH2 (hdr, cur, ord_next) {
if (re && re->re) {
if (!rspamd_regexp_match (re->re, cur->name,
strlen (cur->name), FALSE)) {