From 2bfafad4cb589ee3c5d905d2491165ac1b8651cd Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Fri, 23 Jan 2026 22:32:57 +0100 Subject: [PATCH 01/12] Bump version. Signed-off-by: Thomas Hochstein --- ChangeLog | 3 +++ bin/yapfaq.pl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1a4a511..1705401 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +yapfaq 1.1.0 (unreleased) + + yapfaq 1.0.0 (2025-01-23) * Complete rewrite. * Add POD. diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index 89ae88d..5c881cf 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -19,7 +19,7 @@ # It can be redistributed and/or modified under the same terms under # which Perl itself is published. -my $VERSION = "1.0.0"; +my $VERSION = "1.1.0-unreleased"; (my $NAME = $0) =~ s#^.*/##; use utf8; From 6b73bdfdd3d5bae759bfa4a01f6dd98517e21f48 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 24 Jan 2026 18:25:31 +0100 Subject: [PATCH 02/12] Don't modify headers while --testing if -o is set. Signed-off-by: Thomas Hochstein --- ChangeLog | 2 +- bin/yapfaq.pl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a350e1a..2c79fb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ yapfaq 1.1.0 (unreleased) - +* --test: Set Supersedes and don't modify Message-ID if -o 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 080dd3e..f3bc3ca 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -475,7 +475,7 @@ sub BuildPosting { $_ =~ s/\%p/$$/g; $_ =~ s/\%t/$TimeStamp/g; # add random part in test mode - if ($OptTest) { + if ($OptTest && !$OptOutput) { my $random = sprintf("%08X", rand(0xFFFFFFFF)); $_ =~ s/ to show if just one project is due. =item B<-t>, B<--test> Test mode. Don't update project status (time and Message-ID of last -posting), dont' add a I header and modify the -I with a random part. +posting); if project is posted to Usenet, dont' add a I +header and modify the I with a random part. The text(s) will still be posted if due or forced by B<--force>. From ae4714e30d0554f80ad6b9eba8d8b5409acbf178 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 24 Jan 2026 18:42:41 +0100 Subject: [PATCH 03/12] Imply -o for --testing as long as -n is not set. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c79fb0..c021313 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ yapfaq 1.1.0 (unreleased) * --test: Set Supersedes and don't modify Message-ID if -o is set. +* --test: Force -o if -n is not 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 f3bc3ca..b561dae 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -112,6 +112,9 @@ if ($OptSimulation) { $Config{'verbose'} = 1; } +# -t implies -o if -n is not set +$OptOutput = 1 if $OptTest && !$OptNewsgroup; + ### create list of @Projects from $Config{'datadir'} unless -p is set my @Projects; if (!$OptProject) { @@ -843,7 +846,7 @@ unique I (and no I header). Don't post via NNTP, but print to STDOUT. -Combine with B<--test> to avoid updating project status. +Use B<--test> instead to avoid updating project status. Intended for testing purposes or to pipe in another program like I or I. If you want to pipe the output to another @@ -861,7 +864,7 @@ Display this man page and exit. =item B<-s>, B<--simulation> Simulation mode. Don't post, just show which projects would be due. -Implies B<--test> and B<--verbose>. +Implies B<--test> (without B<--output>) and B<--verbose>. Can be combined with B<--project> to show if just one project is due. @@ -871,10 +874,8 @@ Test mode. Don't update project status (time and Message-ID of last posting); if project is posted to Usenet, dont' add a I header and modify the I with a random part. -The text(s) will still be posted if due or forced by B<--force>. - -Combine with B<--output> to redirect output to STDOUT or with -B<--newsgroup> to override the I header. +Implies B<--output> (to redirect output to STDOUT) as long as +B<--newsgroup> (to override the I header) is not set. =item B<-V>, B<--version> @@ -911,16 +912,16 @@ that are not: Do a test run of your I text and and print it on STDOUT (whether ist is due or not): - yapfaq.pl -t -f -o -p example - (or yapfaq.pl -tfop example) + yapfaq.pl -t -f -p example + (or yapfaq.pl -tfp example) The same, with debugging output (add "-d"): - yapfaq.pl -tfdop example + yapfaq.pl -tfdp example Force a test post of your I text to I, even if -the text is not due to be posted (same as before, just replace "-o" -by "-n alt-test"): +the text is not due to be posted (same as before, just add +"-n alt-test"): yapfaq.pl -t -f -p example -n alt.test From de5163c877f74c088b9878c0cbc7c061c7672cf1 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 24 Jan 2026 18:50:36 +0100 Subject: [PATCH 04/12] Change version suffix to '-pre'(release). Signed-off-by: Thomas Hochstein --- bin/yapfaq.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/yapfaq.pl b/bin/yapfaq.pl index b561dae..be517c0 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -19,7 +19,7 @@ # It can be redistributed and/or modified under the same terms under # which Perl itself is published. -my $VERSION = "1.1.0-unreleased"; +my $VERSION = "1.1.0-pre"; (my $NAME = $0) =~ s#^.*/##; use utf8; From c969b7c2c11c7507cf4da98f86592a4e622bdff3 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 31 Jan 2026 11:19:33 +0100 Subject: [PATCH 05/12] Add conversion script for old status files. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + contrib/convert.pl | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 contrib/convert.pl diff --git a/ChangeLog b/ChangeLog index c021313..9ff8866 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ yapfaq 1.1.0 (unreleased) * --test: Set Supersedes and don't modify Message-ID if -o is set. * --test: Force -o if -n is not set. +* Add conversion script for old status files. yapfaq 1.0.1 (2025-01-24) * Add %t placeholder for Message-ID (feature parity with 0.9). diff --git a/contrib/convert.pl b/contrib/convert.pl new file mode 100755 index 0000000..fa5699a --- /dev/null +++ b/contrib/convert.pl @@ -0,0 +1,16 @@ +#! /usr/bin/perl -w +# +# Convert pre-1.0 yapfaq status file to new format +# +# Usage: convert.pl < old.txt.cfg > new.cfg + +while (<>) { + if (/Lastpost/) { + $_ =~ /Lastpost:\s(\d\d?\.\d\d?\.\d\d\d\d)/; + print "Last-Posted: $1\n"; + } + if (/LastMID/) { + $_ =~ /LastMID:\s(<[^>]+>)/; + print "Last-Message-ID: $1\n"; + } +} From 67182bc6430675a234093d1f49bb969f160537d8 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 31 Jan 2026 22:41:22 +0100 Subject: [PATCH 06/12] Fix ChangeLog format. Signed-off-by: Thomas Hochstein --- ChangeLog | 380 +++++++++++++++++++++++++++--------------------------- 1 file changed, 190 insertions(+), 190 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ff8866..b8daa92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,218 +1,218 @@ yapfaq 1.1.0 (unreleased) -* --test: Set Supersedes and don't modify Message-ID if -o is set. -* --test: Force -o if -n is not set. -* Add conversion script for old status files. + * --test: Set Supersedes and don't modify Message-ID if -o is set. + * --test: Force -o if -n is not set. + * Add conversion script for old status files. yapfaq 1.0.1 (2025-01-24) -* Add %t placeholder for Message-ID (feature parity with 0.9). -* Remove debugging code. + * Add %t placeholder for Message-ID (feature parity with 0.9). + * Remove debugging code. yapfaq 1.0.0 (2025-01-23) -* Complete rewrite. -* Add POD. -* Fix file handling (UTF8 mode). -* Show next posting date if posting is not due. -* Add --simulation mode. -* Update examples in POD. -* Use local time. + * Complete rewrite. + * Add POD. + * Fix file handling (UTF8 mode). + * Show next posting date if posting is not due. + * Add --simulation mode. + * Update examples in POD. + * Use local time. yapfaq 0.10 (unreleased) -* Add: Charset definition. - Fixes #29. -* Mark yapfaq.pl executable. -* Change mail address. + * Add: Charset definition. + Fixes #29. + * Mark yapfaq.pl executable. + * Change mail address. yapfaq 0.9.1 (2010-11-01) -* Fix: Test mode: Add X-Supersedes only if Supersedes would be set. - Fixes #28. - Thomas Hochstein Sun Oct 31 18:42:52 2010 +0100 + * Fix: Test mode: Add X-Supersedes only if Supersedes would be set. + Fixes #28. + Thomas Hochstein Sun Oct 31 18:42:52 2010 +0100 yapfaq 0.9 (2010-09-11) -* Drop use of Fcntl (not needed). - Thomas Hochstein Tue Jun 15 22:30:11 2010 +0200 -* Changed packaging. - - Drop .yapfaqrc and yapfaq.cfg in favor of .yapfaqrc.sample - and yapfaq.cfg.sample; rename test.txt to sample.txt. - - Change contents of these files to reflect the new names. - - Update some defaults, change sample.txt contents to English. - - Add "INSTALLATION" chapter to documentation. - Fixes #7. - Thomas Hochstein Sat May 15 19:16:40 2010 +0200 -* Change default Message-ID format. - Thomas Hochstein Sat May 15 19:04:24 2010 +0200 -* Change: Modify headers for test posts. - - Change MID so you can do multiple tests. - - Replace Supersedes with X-Supersedes so you do not delete - postings while testing. - - Add remark ("This is a test message."). - - Change documentation accordingly. - Fixes #6. - Thomas Hochstein Sat May 15 17:22:20 2010 +0200 -* Change: Drop %LM from subject if Last-Modified is not found. - Thomas Hochstein Sat May 15 16:36:52 2010 +0200 + * Drop use of Fcntl (not needed). + Thomas Hochstein Tue Jun 15 22:30:11 2010 +0200 + * Changed packaging. + - Drop .yapfaqrc and yapfaq.cfg in favor of .yapfaqrc.sample + and yapfaq.cfg.sample; rename test.txt to sample.txt. + - Change contents of these files to reflect the new names. + - Update some defaults, change sample.txt contents to English. + - Add "INSTALLATION" chapter to documentation. + Fixes #7. + Thomas Hochstein Sat May 15 19:16:40 2010 +0200 + * Change default Message-ID format. + Thomas Hochstein Sat May 15 19:04:24 2010 +0200 + * Change: Modify headers for test posts. + - Change MID so you can do multiple tests. + - Replace Supersedes with X-Supersedes so you do not delete + postings while testing. + - Add remark ("This is a test message."). + - Change documentation accordingly. + Fixes #6. + Thomas Hochstein Sat May 15 17:22:20 2010 +0200 + * Change: Drop %LM from subject if Last-Modified is not found. + Thomas Hochstein Sat May 15 16:36:52 2010 +0200 yapfaq 0.8.2 (2010-05-15) -* Fix: Accept leading/trailing whitespace for Last-modified pseudo header. - Fixes #5. - Thomas Hochstein Sat May 15 16:32:58 2010 +0200 + * Fix: Accept leading/trailing whitespace for Last-modified pseudo header. + Fixes #5. + Thomas Hochstein Sat May 15 16:32:58 2010 +0200 yapfap 0.8.1 (2010-05-14) -* Fix broken implementation of "Program" in .yapfaqrc. - Fixes #4. - Thomas Hochstein 2010-05-14 21:58:15 + * Fix broken implementation of "Program" in .yapfaqrc. + Fixes #4. + Thomas Hochstein 2010-05-14 21:58:15 yapfaq 0.8 (2010-05-13) -* Documentation: Add Git repository and bug tracker. - Thomas Hochstein Thu May 13 19:21:05 2010 +0200 -* Making use of Getopt::Std's --help and --version. - Fixes #3. - Thomas Hochstein Thu May 13 19:33:25 2010 +0200 -* New: Add "Program" to .yapfaqrc. - Fixes #2. - Thomas Hochstein Thu May 13 19:31:49 2010 +0200 -* Change: Drop PGP support. - You may use tinews.pl from - ftp://ftp.tin.org/tin/tools/tinews.pl instead. - Fixes #1. - Thomas Hochstein Thu May 13 19:24:44 2010 +0200 -* Fix: Consistency check for MID-Format fixed (regexp). - Thomas Hochstein Wed Apr 14 23:17:16 2010 +0200 -* New: MID-Format may now contain %t for a Unix timestamp. - %t will be replaced by the number of seconds since the epoch. - Thomas Hochstein Wed Apr 14 23:18:04 2010 +0200 -* Documentation changes - - Change sample yapfaq.cfg (mark optional settings). - Optional settings are mostly commented out. - Thomas Hochstein Wed Apr 14 09:10:05 2010 +0200 - - Fix: Add "-V", NNTPSERVER to documentation, add more examples. - Added examples for -s and -c. - Thomas Hochstein Wed Apr 14 10:02:48 2010 +0200 - - Add comments pointing to .yapfaqrc to source. - Thomas Hochstein Wed Apr 14 10:10:28 2010 +0200 -* readconfig(): Add file name to verbose output. - Thomas Hochstein Wed Apr 14 09:38:23 2010 +0200 -* Change: Reset default for NNTPServer to "unset". - Since yapfaq fill fall back to Perl's build-in defaults, - that should be no problem; furthermore user may now - override this setting via .yapfaqrc without changing - the code. - Thomas Hochstein Wed Apr 14 09:11:45 2010 +0200 + * Documentation: Add Git repository and bug tracker. + Thomas Hochstein Thu May 13 19:21:05 2010 +0200 + * Making use of Getopt::Std's --help and --version. + Fixes #3. + Thomas Hochstein Thu May 13 19:33:25 2010 +0200 + * New: Add "Program" to .yapfaqrc. + Fixes #2. + Thomas Hochstein Thu May 13 19:31:49 2010 +0200 + * Change: Drop PGP support. + You may use tinews.pl from + ftp://ftp.tin.org/tin/tools/tinews.pl instead. + Fixes #1. + Thomas Hochstein Thu May 13 19:24:44 2010 +0200 + * Fix: Consistency check for MID-Format fixed (regexp). + Thomas Hochstein Wed Apr 14 23:17:16 2010 +0200 + * New: MID-Format may now contain %t for a Unix timestamp. + %t will be replaced by the number of seconds since the epoch. + Thomas Hochstein Wed Apr 14 23:18:04 2010 +0200 + * Documentation changes + - Change sample yapfaq.cfg (mark optional settings). + Optional settings are mostly commented out. + Thomas Hochstein Wed Apr 14 09:10:05 2010 +0200 + - Fix: Add "-V", NNTPSERVER to documentation, add more examples. + Added examples for -s and -c. + Thomas Hochstein Wed Apr 14 10:02:48 2010 +0200 + - Add comments pointing to .yapfaqrc to source. + Thomas Hochstein Wed Apr 14 10:10:28 2010 +0200 + * readconfig(): Add file name to verbose output. + Thomas Hochstein Wed Apr 14 09:38:23 2010 +0200 + * Change: Reset default for NNTPServer to "unset". + Since yapfaq fill fall back to Perl's build-in defaults, + that should be no problem; furthermore user may now + override this setting via .yapfaqrc without changing + the code. + Thomas Hochstein Wed Apr 14 09:11:45 2010 +0200 yapfaq 0.7 (2010-04-14) -* Change: readconfig(): Make mid-format optional. - Set defaults for expires and mid-format when they're invalid - (defaults were already set in postfaq() if undefined). - Change documentation accordingly; make it more clear if - parameters are optional or mandatory. - Thomas Hochstein Tue Apr 13 23:59:43 2010 +0200 -* Fix: Save status information only after successful posting. - - New Function: updatestaus - Move status information save to updatestatus. - - post() now returns exit code. - - postfaq() will update status information only - when post() was successful. - Thomas Hochstein Sat Apr 10 23:19:44 2010 +0200 -* New: Add option '-s': pipe article to script. - Use an external program to post - or otherwise handle - - the article. - Amend documentation. - Thomas Hochstein Sat Apr 10 02:14:59 2010 +0200 -* New: runtime configuration - - Moved configuration to a hash (%Config). - Thomas Hochstein Wed Apr 7 22:09:15 2010 +0200 - - Add rcfile (.yapfaqrc) for configuration. - All configuration data is read from .yapfaqrc - with defaults set in yapfaq.pl - Thomas Hochstein Sat Apr 10 22:02:24 2010 +0200 - - Add sample .yapfaqrc with defaults. - Thomas Hochstein Wed Apr 7 23:16:20 2010 +0200 - - Add option '-c': define another .rcfile. - Thomas Hochstein Thu Apr 8 07:41:43 2010 +0200 - - Update documentation for .rcfile. - Add the according sections to the POD documentation. - Fix some wording. - Thomas Hochstein Sat Apr 10 02:17:00 2010 +0200 -* Small changes. - -t CONSOLE: Change delimiter. - No leading \n is necessary. - Add some more comments. - Thomas Hochstein Sat Apr 10 01:43:19 2010 +0200 -* Add option '-V': print version and copyright information. - Thomas Hochstein Thu Apr 8 07:36:11 2010 +0200 -* Change: -h: Replace version/usage information with man page. - Feed script to perldoc when called with -h. - Thomas Hochstein Thu Apr 8 06:21:05 2010 +0200 -* Change: Authenticate only if $NNTPUser is set. - Thomas Hochstein Sat Apr 10 00:49:24 2010 +0200 -* Add check for MID-Format and fallback to FQDN. - Uses hostfqdn from Net::Domain. - Thomas Hochstein Thu Apr 8 08:33:01 2010 +0200 -* Add checks for mandatory content in configuration file. - Enhance and optimize existing checks. - Thomas Hochstein Thu Apr 8 08:30:21 2010 +0200 -* Code optimisation (verbose output). - Thomas Hochstein Thu Apr 8 08:00:04 2010 +0200 + * Change: readconfig(): Make mid-format optional. + Set defaults for expires and mid-format when they're invalid + (defaults were already set in postfaq() if undefined). + Change documentation accordingly; make it more clear if + parameters are optional or mandatory. + Thomas Hochstein Tue Apr 13 23:59:43 2010 +0200 + * Fix: Save status information only after successful posting. + - New Function: updatestaus + Move status information save to updatestatus. + - post() now returns exit code. + - postfaq() will update status information only + when post() was successful. + Thomas Hochstein Sat Apr 10 23:19:44 2010 +0200 + * New: Add option '-s': pipe article to script. + Use an external program to post - or otherwise handle - + the article. + Amend documentation. + Thomas Hochstein Sat Apr 10 02:14:59 2010 +0200 + * New: runtime configuration + - Moved configuration to a hash (%Config). + Thomas Hochstein Wed Apr 7 22:09:15 2010 +0200 + - Add rcfile (.yapfaqrc) for configuration. + All configuration data is read from .yapfaqrc + with defaults set in yapfaq.pl + Thomas Hochstein Sat Apr 10 22:02:24 2010 +0200 + - Add sample .yapfaqrc with defaults. + Thomas Hochstein Wed Apr 7 23:16:20 2010 +0200 + - Add option '-c': define another .rcfile. + Thomas Hochstein Thu Apr 8 07:41:43 2010 +0200 + - Update documentation for .rcfile. + Add the according sections to the POD documentation. + Fix some wording. + Thomas Hochstein Sat Apr 10 02:17:00 2010 +0200 + * Small changes. + -t CONSOLE: Change delimiter. + No leading \n is necessary. + Add some more comments. + Thomas Hochstein Sat Apr 10 01:43:19 2010 +0200 + * Add option '-V': print version and copyright information. + Thomas Hochstein Thu Apr 8 07:36:11 2010 +0200 + * Change: -h: Replace version/usage information with man page. + Feed script to perldoc when called with -h. + Thomas Hochstein Thu Apr 8 06:21:05 2010 +0200 + * Change: Authenticate only if $NNTPUser is set. + Thomas Hochstein Sat Apr 10 00:49:24 2010 +0200 + * Add check for MID-Format and fallback to FQDN. + Uses hostfqdn from Net::Domain. + Thomas Hochstein Thu Apr 8 08:33:01 2010 +0200 + * Add checks for mandatory content in configuration file. + Enhance and optimize existing checks. + Thomas Hochstein Thu Apr 8 08:30:21 2010 +0200 + * Code optimisation (verbose output). + Thomas Hochstein Thu Apr 8 08:00:04 2010 +0200 yapfaq 0.6.2 (2010-02-26) -* Fix default for Expires. - Bug introduced in v0.6.1. - Thomas Hochstein Fri Feb 26 09:29:01 2010 +0100 + * Fix default for Expires. + Bug introduced in v0.6.1. + Thomas Hochstein Fri Feb 26 09:29:01 2010 +0100 yapfaq 0.6.1 (2010-02-26) -* Fix: Test mode must not update status information. - Also fix runtime warning concerning expires. - Thomas Hochstein Fri Feb 26 08:28:06 2010 +0100 + * Fix: Test mode must not update status information. + Also fix runtime warning concerning expires. + Thomas Hochstein Fri Feb 26 08:28:06 2010 +0100 yapfaq 0.6 (2010-02-25) -* Add documentation in POD format. - Thomas Hochstein Thu Feb 25 17:00:07 2010 +0100 -* Add commandline options. - - Using Getopt::Std. - - Implement option '-h': - Display version and usage information. - - Implement option '-v': - Print progress information to STDOUT on reading the configuration, - skipping a FAQ, preparing it for posting, posting it and writing - status information to disk. - - Implement option '-f': - Limit operation to the given project name. Skip parsing all other - information from yapfaq.cfg, skip posting all other FAQs. - - Add option '-d': - 'dry run', simulation mode: nothing is posted. - - Add option '-p': - 'post anyway', files are unconditionally posted irrespective of - Posting-Frequency settings. - - Add option '-t ': - 'test mode', post to (an)other newsgroup(s) given on the command - line or to STDOUT ('console'). - Thomas Hochstein Thu Feb 25 19:22:15 2010 +0100 -* Add variable expiry. - - New Function: calcdelta - Move date calculation for new posting date to - calcdelta. - - Add 'Expires' to yapfaq.cfg - Parse 'Expires'. - Use calcdelta to calculate expiry. - Thomas Hochstein Thu Feb 25 12:55:04 2010 +0100 -* Cleanup on yapfaq.cfg - Reformat, translate to English language, add descriptions. - Thomas Hochstein Thu Feb 25 16:16:49 2010 +0100 -* Change handling of warnings/errors. - Don't output line number if .cfg file can't be opened. - Inform user when writing to ERROR.dat. - Add script name and Warning/Error to warn() and die() output. - Thomas Hochstein Thu Feb 25 09:23:14 2010 +0100 -* Fix: Accept case-insensitive Last-modified pseudo header. - Thomas Hochstein Sun Feb 21 18:39:05 2010 +0100 -* Change defaults - Don't use PGP by default. - Default $NNTPServer to 'localhost' - Thomas Hochstein Thu Feb 25 15:15:57 2010 +0100 -* Update header/introduction, bump version/copyright information. - Fix typo/language in header/introduction. - Add new author / copyright information. - Bump version to 0.6-unreleased. - Thomas Hochstein Sun Feb 21 18:51:39 2010 +0100 + * Add documentation in POD format. + Thomas Hochstein Thu Feb 25 17:00:07 2010 +0100 + * Add commandline options. + - Using Getopt::Std. + - Implement option '-h': + Display version and usage information. + - Implement option '-v': + Print progress information to STDOUT on reading the configuration, + skipping a FAQ, preparing it for posting, posting it and writing + status information to disk. + - Implement option '-f': + Limit operation to the given project name. Skip parsing all other + information from yapfaq.cfg, skip posting all other FAQs. + - Add option '-d': + 'dry run', simulation mode: nothing is posted. + - Add option '-p': + 'post anyway', files are unconditionally posted irrespective of + Posting-Frequency settings. + - Add option '-t ': + 'test mode', post to (an)other newsgroup(s) given on the command + line or to STDOUT ('console'). + Thomas Hochstein Thu Feb 25 19:22:15 2010 +0100 + * Add variable expiry. + - New Function: calcdelta + Move date calculation for new posting date to + calcdelta. + - Add 'Expires' to yapfaq.cfg + Parse 'Expires'. + Use calcdelta to calculate expiry. + Thomas Hochstein Thu Feb 25 12:55:04 2010 +0100 + * Cleanup on yapfaq.cfg + Reformat, translate to English language, add descriptions. + Thomas Hochstein Thu Feb 25 16:16:49 2010 +0100 + * Change handling of warnings/errors. + Don't output line number if .cfg file can't be opened. + Inform user when writing to ERROR.dat. + Add script name and Warning/Error to warn() and die() output. + Thomas Hochstein Thu Feb 25 09:23:14 2010 +0100 + * Fix: Accept case-insensitive Last-modified pseudo header. + Thomas Hochstein Sun Feb 21 18:39:05 2010 +0100 + * Change defaults + Don't use PGP by default. + Default $NNTPServer to 'localhost' + Thomas Hochstein Thu Feb 25 15:15:57 2010 +0100 + * Update header/introduction, bump version/copyright information. + Fix typo/language in header/introduction. + Add new author / copyright information. + Bump version to 0.6-unreleased. + Thomas Hochstein Sun Feb 21 18:51:39 2010 +0100 Version 0.5a From 41d307a2fefc76593dc3be8d12b22929fc555031 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 18:48:27 +0100 Subject: [PATCH 07/12] Accept a posting-frequency of "never", too. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8daa92..1500766 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ yapfaq 1.1.0 (unreleased) * --test: Set Supersedes and don't modify Message-ID if -o is set. * --test: Force -o if -n is not set. * Add conversion script for old status files. + * Accept a posting-frequency of "never", too. 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 be517c0..eebe9b7 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -515,8 +515,8 @@ sub BuildPosting { } } - # not due if Posting-Freqency is "none" - if ($PostingFrequency =~ /none/) { + # not due if Posting-Freqency is "none" or never + if ($PostingFrequency =~ /none|never/) { print "... is disabled.\n" if $Config{'verbose'} or $Config{'debug'}; return ''; } From 3801b61d7720ce3a08c53e13edd8fd1412104ce9 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 18:48:57 +0100 Subject: [PATCH 08/12] Check for illegal headers and stop posting. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1500766..8851f28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ yapfaq 1.1.0 (unreleased) * --test: Force -o if -n is not set. * Add conversion script for old status files. * Accept a posting-frequency of "never", too. + * Check for illegal headers and stop posting, if found. 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 eebe9b7..11494cc 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -412,6 +412,17 @@ sub BuildPosting { return ''; } + # check for illegal headers + my $FoundIllegalHeader = 0; + foreach (qw/Date User-Agent X-Newsreader X-Mailer Injection-Date + Injection-Info NNTP-Posting-Date NNTP-Posting-Host X-Trace/) { + if ($Header{lc($_)}) { + warn "W: $_ header may not be set in '$HeaderFile'.\n"; + $FoundIllegalHeader = 1; + } + } + return '' if $FoundIllegalHeader; + # add Date: push @Headers, 'Date: ' . $TD->strftime('%a, %d %b %Y %H:%M:%S %z') . "\n"; # add missing Message-ID: From 1e7bccbbec7d0ecd65b3e98bcca8b6e61e952331 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 18:59:38 +0100 Subject: [PATCH 09/12] Disabled projects must be posted, if forced. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8851f28..c2cabf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ yapfaq 1.1.0 (unreleased) * Add conversion script for old status files. * Accept a posting-frequency of "never", too. * Check for illegal headers and stop posting, if found. + * Disabled projects must be posted, if forced. 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 11494cc..81b645d 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -527,7 +527,7 @@ sub BuildPosting { } # not due if Posting-Freqency is "none" or never - if ($PostingFrequency =~ /none|never/) { + if ($PostingFrequency =~ /none|never/ && !$OptForce) { print "... is disabled.\n" if $Config{'verbose'} or $Config{'debug'}; return ''; } From cc881f7897a28a561987a32b1bc6d999e0e73418 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 19:20:10 +0100 Subject: [PATCH 10/12] Warn of unencoded 8bit characters in header or body if -d is set. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 10 ++++++++++ 2 files changed, 11 insertions(+) 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) { From 66435ceda0749847af9da16ed3df5cbf79936790 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 19:21:03 +0100 Subject: [PATCH 11/12] Update POD. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c6c23f..c8db122 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ yapfaq 1.1.0 (unreleased) * 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. + * Update POD. 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 f7af3f7..3c018d1 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -761,7 +761,14 @@ files need to be in B. Needs to have at least I, I and I and can contain all other headers that the posting should have. Headers must conform to RFC 5536 and RFC 5322 and use MIME encoded words for -8bit characters. B won't convert headers. +8bit characters. B won't convert headers, but will warn of +unencoded 8bit characters in B<--debug> mode. Longer headers should +be folded; B won't fold headers. + +The headers file must not contain any of the following headers: +I, I, I, I, +I, I, I, +I or I. I may contain a I<%LM> placeholder that will be replaced with the I pseudo-header from the text file @@ -823,7 +830,8 @@ I and I will be evaluated by B. If your content contains 8bit characters, you'll need suitable MIME -headers in your headers file. +headers in your headers file. B will warn of unencoded 8bit +characters with missung MIME headers in B<--debug> mode. B From 2e4c6984e64f76015a9ff54775f93c036d33d00c Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sat, 7 Feb 2026 19:38:53 +0100 Subject: [PATCH 12/12] Add option to add common headers to all projects. Signed-off-by: Thomas Hochstein --- ChangeLog | 1 + bin/yapfaq.pl | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index c8db122..8018b24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ yapfaq 1.1.0 (unreleased) * Disabled projects must be posted, if forced. * Warn of unencoded 8bit characters in header or body if -d is set. * Update POD. + * Add an option for a common headers file for all projects. 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 3c018d1..210015b 100755 --- a/bin/yapfaq.pl +++ b/bin/yapfaq.pl @@ -45,6 +45,8 @@ $Config{'nntp-pass'} = ''; # password for AUTHINFO $Config{'force-auth'} = 0; # set to 1 to force authentication $Config{'starttls'} = 0; # set to 1 to use STARTTLS if possible +$Config{'xtraheaders'} = ''; # path to file with extra headers + $Config{'verbose'} = 0; # set to 1 to get status messages $Config{'debug'} = 0; # set to 1 to get some debug output, # set to 2 for NNTP debug output @@ -100,6 +102,7 @@ GetOptions ('p|project=s' => \$OptProject, 'nntp-pass=s' => \$Config{'nntp-pass'}, 'starttls!' => \$Config{'starttls'}, 'force-auth!' => \$Config{'force-auth'}, + 'xtraheaders=s' => \$Config{'xtraheaders'}, 'v|verbose!' => \$Config{'verbose'}, 'd|debug!' => \$Config{'debug'}, 'c|config' => \&ShowConf, @@ -377,6 +380,11 @@ sub BuildPosting { warn "W: '$BodyFile' not found.\n"; return ''; } + my $XtraHeaderFile = $Config{'xtraheaders'} if $Config{'xtraheaders'}; + if ($Config{'xtraheaders'} && not -r $XtraHeaderFile) { + warn "W: '$XtraHeaderFile' not found.\n"; + return ''; + } # today (TD) my $TD = DateTime->now->set_time_zone('local'); @@ -404,6 +412,10 @@ sub BuildPosting { print "- Reading headers ($Project.hdr) and body ($Project.txt).\n" if $Config{'debug'}; my @Headers = path($HeaderFile)->lines; my @Body = path($BodyFile)->lines; + if ($Config{'xtraheaders'}) { + print "- Reading extra headers ($XtraHeaderFile).\n" if $Config{'debug'}; + push @Headers, path($XtraHeaderFile)->lines ; + } my %Header = &ParseHeaders(@Headers); # check for mandatory headers @@ -748,6 +760,14 @@ Use a TLS encrypted connection (via STARTTLS) if available. You can override this option on the command line by using B<--starttls> or B<--nostarttls> accordingly. +=item B = I + +Path to a file with common headers for all project files. Those +headers will be appended to each project. + +You can override this option on the command line by using +B<--xtraheaders> = I. + =back =head2 Project files