🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: xs4all.general
Article #144

Re: [aankondiging] - Migratie Cistron home/mail directories

#144
From: Miquel van Smoorenburg
Date: Wed, 09 Mar 2005 23:04
57 lines
2498 bytes
In article <d0ntbv$oii$1@newsbin.cistron.nl>,
Marco van Loon <veritech@chaos.adpolice.megatokyo.invalid> wrote:
>finger username@bsmtp.cistron.nl |less
>was een best bruikbare manier om even snel te checken of er een mailtje
>van een bekende in de BSMTP queue stond tussen de 95% spam die de
>volgende 10 minuten door het dial-up modem gepompt zouden worden...

Okee, ik heb even een script voor je in elkaar geklopt.

ssh xslogin_hier@xs4all.nl './bsmtpq.pl xslogin_hier'

Even je lokale .ssh/id_dsa.pub remote in .ssh/authorized_keys zetten
en je hoeft geen wachtwoord te geven ook.

Mike.

------8<-----snip-here----8<-----

#! /usr/bin/perl

sub usage {
	die "Usage: bsmtpq <loginname>\n";
}

sub show {
	local *FD;
	my $f = shift;
	my @s;

	open(FD, "<$f") or return;

	while(<FD>) {
		last if (/^$/);
		if (/^(Return-Path|X-XS4ALL-To|Subject)/i) {
			push @s, $_;
		}
	}
	close FD;
	print @s, "\n" if (grep(/^X-XS4ALL-To:/mi, @s));
}

usage() if ($#ARGV != 0);
my ($letter, $letter2) = ($ARGV[0] =~ m/^(.)(.)/);
my $dir = "/var/spool/mail/$letter/$letter2/$ARGV[0]/new";
usage() unless (-d $dir);

chdir($dir) or die "$dir: $!\n";

opendir(D, ".");
while (my $f = readdir(D)) {
	show($f) if (-f  $f);
}
closedir D;

1;

------8<-----snip-here----8<-----
Technical Details
Message-ID: <d0nvd8$gt1$1@news.cistron.nl>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!news.cistron.nl!not-for-mail
References: <d0k6fr$p51$1@news.cistron.nl> <d0leqp$ah8$1@newsbin.cistron.nl> <Xns96145952B704Cjan1963@194.109.133.29> <d0ntbv$oii$1@newsbin.cistron.nl>

Show Full Headers
Complete Article Headers
X-Google-Thread: f775e,1f2743abd85b7b7a
X-Google-Thread: 10c942,e41d07c6afbe8671
X-Google-Attributes: gidf775e,gid10c942,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!news.cistron.nl!not-for-mail
From: "Miquel van Smoorenburg" <miquels@xs4all.invalid>
Newsgroups: xs4all.general,cistron.general
Subject: Re: [aankondiging] - Migratie Cistron home/mail directories
Date: Wed, 9 Mar 2005 23:04:08 +0000 (UTC)
Organization: Cistron
Lines: 58
Message-ID: <d0nvd8$gt1$1@news.cistron.nl>
References: <d0k6fr$p51$1@news.cistron.nl> <d0leqp$ah8$1@newsbin.cistron.nl> <Xns96145952B704Cjan1963@194.109.133.29> <d0ntbv$oii$1@newsbin.cistron.nl>
NNTP-Posting-Host: zahadum.xs4all.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
X-Trace: ncc1701.cistron.net 1110409448 17313 194.109.0.112 (9 Mar 2005 23:04:08 GMT)
X-Complaints-To: abuse@cistron.nl
NNTP-Posting-Date: Wed, 9 Mar 2005 23:04:08 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Originator: mikevs@cistron.nl (Miquel van Smoorenburg)