diff --git a/ChangeLog b/ChangeLog index c2cabf1..0c6c23f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index 81b645d..f7af3f7 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -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) {