summaryrefslogtreecommitdiffstats
path: root/src/cleanup/cleanup_milter.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:42:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:42:06 +0000
commit426ff88c97805d5359804bcfd7186dcd2c9fbf47 (patch)
tree048956abd950b325107bcc2febb1ba6763d770e1 /src/cleanup/cleanup_milter.c
parentAdding debian version 3.8.6-1. (diff)
downloadpostfix-426ff88c97805d5359804bcfd7186dcd2c9fbf47.tar.xz
postfix-426ff88c97805d5359804bcfd7186dcd2c9fbf47.zip
Merging upstream version 3.9.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/cleanup/cleanup_milter.c')
-rw-r--r--src/cleanup/cleanup_milter.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cleanup/cleanup_milter.c b/src/cleanup/cleanup_milter.c
index 491de25..a35344c 100644
--- a/src/cleanup/cleanup_milter.c
+++ b/src/cleanup/cleanup_milter.c
@@ -2444,6 +2444,7 @@ static void open_queue_file(CLEANUP_STATE *state, const char *path)
long data_offset;
long rcpt_count;
long qmgr_opts;
+ const HEADER_OPTS *opts;
if (state->dst != 0) {
msg_warn("closing %s", cleanup_path);
@@ -2455,6 +2456,7 @@ static void open_queue_file(CLEANUP_STATE *state, const char *path)
if ((state->dst = vstream_fopen(path, O_RDWR, 0)) == 0) {
msg_warn("open %s: %m", path);
} else {
+ var_drop_hdrs = "";
cleanup_path = mystrdup(path);
for (;;) {
if ((curr_offset = vstream_ftell(state->dst)) < 0)
@@ -2511,9 +2513,16 @@ static void open_queue_file(CLEANUP_STATE *state, const char *path)
msg_fatal("file %s: vstream_ftell: %m", cleanup_path);
}
}
+ } else if (rec_type == REC_TYPE_NORM && state->hop_count == 0
+ && (opts = header_opts_find(STR(buf))) != 0
+ && opts->type == HDR_RECEIVED) {
+ state->hop_count += 1;
+ /* XXX Only the first line of the first Received: header. */
+ argv_add(state->auto_hdrs, STR(buf), ARGV_END);
}
if (state->append_rcpt_pt_offset > 0
&& state->append_hdr_pt_offset > 0
+ && state->hop_count > 0
&& (rec_type == REC_TYPE_END
|| state->append_meta_pt_offset > 0))
break;