-
Notifications
You must be signed in to change notification settings - Fork 10
/
mail.cgi
executable file
·104 lines (73 loc) · 1.94 KB
/
mail.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/perl -I.
require "date.pm";
require "libssh2.pm";
require CGI;
$req = new CGI;
my $list = $req->param('list');
header("libssh2-devel mailing list archives", "mail");
sub showarchs {
my ($num, @dirs) = @_;
my %years;
my %mos;
if($num > 0) {
while(scalar(@dirs) > $num) {
shift @dirs;
}
}
for(@dirs) {
if($_ =~ /(\d\d\d\d)-(\d\d)/) {
$years{$1}=1;
$mos{$1}{$2}=1;
}
}
@syears = reverse sort keys %years;
print "<p><table class=archive>\n";
for(@syears) {
$thisyear=$_;
my $pr=0;
print "<tr>\n";
print "<th>$thisyear</th>\n";
for my $d (1 .. 12) {
my $dd = sprintf("%02d", $d);
if($mos{$thisyear}{$dd}) {
$year=$1;
$mon=$2;
printf("<td><a href=\"mail/libssh2-devel-archive-%04d-%02d/\">%s</a></td>\n",
$thisyear, $d, substr(&MonthNameEng($d), 0, 3));
}
else {
# blank
print "<td></td>";
}
}
print "</tr>\n";
}
print "</tr></table>\n";
}
sub archive {
my ($num)=@_;
my $some_dir="mail";
opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
my @dirs = sort {$a cmp $b} grep { /^libssh2-devel-archive-/ && -d "$some_dir/$_" } readdir(DIR);
closedir DIR;
&showarchs($num, @dirs);
}
print <<END;
<p>
<div class=title align=left> libssh2 Mailing List Archives</div>
<div class="box">
Archived mails sent to the <a
href="https://lists.haxx.se/listinfo/libssh2-devel">libssh2-devel</a> mailing
list can be found <a
href="https://lists.haxx.se/pipermail/libssh2-devel/">here</a>.
<p>
The old mailing list archive is here:
END
archive(-1);
print <<MOO
<p> <a href="https://lists.haxx.se/listinfo/libssh2-devel">subscribe
here</a>.
</div>
MOO
;
&footer();