user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 1/2] import_slrnspool: fix off-by-one error
@ 2015-01-11  4:47 Eric Wong
  2015-01-11  4:47 ` [PATCH 2/2] *slrnspool* old gmane archives set Original-To Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2015-01-11  4:47 UTC (permalink / raw)
  To: meta

We start with zero and only store the next valid ID.
---
 scripts/import_slrnspool | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/import_slrnspool b/scripts/import_slrnspool
index 560c08c..fec7ebf 100755
--- a/scripts/import_slrnspool
+++ b/scripts/import_slrnspool
@@ -25,7 +25,7 @@ use Data::Dumper; print STDERR Dumper($cfg);
 
 sub get_min {
 	my ($cfg) = @_;
-	$cfg->{importslrnspoolstate} || 1
+	$cfg->{importslrnspoolstate} || 0;
 }
 
 sub set_min {
-- 
EW


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] *slrnspool* old gmane archives set Original-To
  2015-01-11  4:47 [PATCH 1/2] import_slrnspool: fix off-by-one error Eric Wong
@ 2015-01-11  4:47 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-01-11  4:47 UTC (permalink / raw)
  To: meta

Apparently it's not a problem with recent archives.
---
 scripts/import_slrnspool  | 11 +++++++----
 scripts/slrnspool2maildir | 11 +++++++----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/scripts/import_slrnspool b/scripts/import_slrnspool
index fec7ebf..ea7a97b 100755
--- a/scripts/import_slrnspool
+++ b/scripts/import_slrnspool
@@ -50,10 +50,13 @@ for (; $n < $max; $n++) {
 	my $s = $f->simple;
 
 	# gmane rewrites Received headers, which increases spamminess
-	my @h = $s->header('Original-Received');
-	if (@h) {
-		$s->header_set('Received', @h);
-		$s->header_set('Original-Received');
+	# Some older archives set Original-To
+	foreach my $x (qw(Received To)) {
+		my @h = $s->header("Original-$x");
+		if (@h) {
+			$s->header_set($x, @h);
+			$s->header_set("Original-$x");
+		}
 	}
 
 	# triggers for the SA HEADER_SPAM rule
diff --git a/scripts/slrnspool2maildir b/scripts/slrnspool2maildir
index 12510a3..0831397 100755
--- a/scripts/slrnspool2maildir
+++ b/scripts/slrnspool2maildir
@@ -27,10 +27,13 @@ foreach my $n (grep(/\d+\z/, glob("$spool/*"))) {
 		my $s = $f->simple;
 
 		# gmane rewrites Received headers, which increases spamminess
-		my @h = $s->header('Original-Received');
-		if (@h) {
-			$s->header_set('Received', @h);
-			$s->header_set('Original-Received');
+		# Some older archives set Original-To
+		foreach my $x (qw(Received To)) {
+			my @h = $s->header("Original-$x");
+			if (@h) {
+				$s->header_set($x, @h);
+				$s->header_set("Original-$x");
+			}
 		}
 
 		# triggers for the SA HEADER_SPAM rule
-- 
EW


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-11  4:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-11  4:47 [PATCH 1/2] import_slrnspool: fix off-by-one error Eric Wong
2015-01-11  4:47 ` [PATCH 2/2] *slrnspool* old gmane archives set Original-To Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).