Warn of unencoded 8bit characters in header or body if -d is set.

Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
Thomas Hochstein 2026-02-07 19:20:10 +01:00
parent 1e7bccbbec
commit cc881f7897
2 changed files with 11 additions and 0 deletions

View file

@ -5,6 +5,7 @@ yapfaq 1.1.0 (unreleased)
* Accept a posting-frequency of "never", too.
* Check for illegal headers and stop posting, if found.
* Disabled projects must be posted, if forced.
* Warn of unencoded 8bit characters in header or body if -d is set.
yapfaq 1.0.1 (2025-01-24)
* Add %t placeholder for Message-ID (feature parity with 0.9).

View file

@ -430,6 +430,16 @@ sub BuildPosting {
# add User-Agent
push @Headers, "User-Agent: $NAME/$VERSION\n";
# check for unencoded 8bit characters in header or body in --debug mode
# taken from tinews.pl
if ($Config{'debug'}) {
print "- Raw 8-bit data in headers.\n" if (grep {/[\x80-\xff]/} @Headers);
# check for MIME headers and warn for 8bit characters in body if missing
if (!defined($Header{'mime-version'}) || !defined($Header{'content-type'})) {
print "- 8bit data in body without MIME-headers.\n" if (grep {/[\x80-\xff]/} @Body);
}
}
# parse pseudo headers from body
my ($InRealBody,$LastModified,$PostingFrequency);
foreach (@Body) {