}
+#### Replace generated Content-ID headers with static value
+replace_contentid()
+{
+ sed "/^Content-ID/s/:.*/: <TESTID>/" "$@"
+}
+
#### Filter that squeezes blank lines, partially emulating GNU cat -s,
#### but sufficient for our purpose.
foo
!
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
From: Bob <bob@example.org>
To: alice
Date: Sun, 25 Oct 2015 18:59:56 +0100
--------
foo
!
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
To: meillo
Subject: mime test 1
Date: Fri, 05 Aug 2016 21:38:40 +0200
foo
füße
!
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
To: meillo
Subject: mime test 2
Date: Fri, 05 Aug 2016 21:38:56 +0200
--------
foo
!
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft" | replace_contentid' <<!
To: meillo
Subject: mime test 3
MIME-Version: 1.0
!
runandcheck 'mhbuild "$draft"' <<!
!
+
+# Use static Content-ID headers values for reproducible results
+replace_contentid "$draft" >"$draft.temp" && mv "$draft.temp" "$draft"
+
runandcheck 'mhlist -v -file "$draft"' <<!
msg part type/subtype size description
- 0 multipart/mixed 2623
+ 0 multipart/mixed 2343
boundary="----- =_aaaaaaaaaa0"
1 text/plain 4
charset="us-ascii"
charset="us-ascii"
4 text/plain 6
charset="UTF-8"
- 5 multipart/alternative 1663 Picture of an Amphioctopus marginatu
+ 5 multipart/alternative 1593 Picture of an Amphioctopus marginatu
boundary="----- =_aaaaaaaaaa1"
5.1 text/plain 87
charset="us-ascii"
6 text/plain 4
charset="us-ascii"
!
-runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+runandcheck 'send -debug "$draft"' <<!
To: meillo
Subject: mime test 6
Date: Fri, 05 Aug 2016 21:46:20 +0200