]> git.donarmstrong.com Git - debbugs.git/blob - cgi/bugreport.cgi
* Add multiple status mailbox types
[debbugs.git] / cgi / bugreport.cgi
1 #!/usr/bin/perl -wT
2
3 package debbugs;
4
5 use warnings;
6 use strict;
7 use POSIX qw(strftime tzset);
8 use MIME::Parser;
9 use MIME::Decoder;
10 use IO::Scalar;
11 use IO::File;
12
13 use Debbugs::Config qw(:globals);
14 #require '/usr/lib/debbugs/errorlib';
15 require './common.pl';
16
17 require '/etc/debbugs/text';
18
19 # for read_log_records
20 use Debbugs::Log;
21 use Debbugs::MIME qw(convert_to_utf8 decode_rfc1522 create_mime_message);
22 use Debbugs::CGI qw(:url :html);
23
24 use Scalar::Util qw(looks_like_number);
25
26 my %param = readparse();
27
28 my $tail_html;
29
30 my $ref = $param{'bug'} || quitcgi("No bug number");
31 $ref =~ /(\d+)/ or quitcgi("Invalid bug number");
32 $ref = $1;
33 my $short = "#$ref";
34 my $msg = $param{'msg'} || "";
35 my $att = $param{'att'};
36 my $boring = ($param{'boring'} || 'no') eq 'yes'; 
37 my $terse = ($param{'terse'} || 'no') eq 'yes';
38 my $reverse = ($param{'reverse'} || 'no') eq 'yes';
39 my $mbox = ($param{'mbox'} || 'no') eq 'yes'; 
40 my $mime = ($param{'mime'} || 'yes') eq 'yes';
41
42 my $trim_headers = ($param{trim} || ($msg?'no':'yes')) eq 'yes';
43
44 my $mbox_status_message = ($param{mboxstat}||'no') eq 'yes';
45 my $mbox_maint = ($param{mboxmaint}||'no') eq 'yes';
46 $mbox = 1 if $mbox_status_message or $mbox_maint;
47
48
49 # Not used by this script directly, but fetch these so that pkgurl() and
50 # friends can propagate them correctly.
51 my $archive = ($param{'archive'} || 'no') eq 'yes';
52 my $repeatmerged = ($param{'repeatmerged'} || 'yes') eq 'yes';
53 set_option('archive', $archive);
54 set_option('repeatmerged', $repeatmerged);
55
56 my $buglog = buglog($ref);
57
58 if (defined $ENV{REQUEST_METHOD} and $ENV{REQUEST_METHOD} eq 'HEAD' and not defined($att) and not $mbox) {
59     print "Content-Type: text/html; charset=utf-8\n";
60     my @stat = stat $buglog;
61     if (@stat) {
62         my $mtime = strftime '%a, %d %b %Y %T GMT', gmtime($stat[9]);
63         print "Last-Modified: $mtime\n";
64     }
65     print "\n";
66     exit 0;
67 }
68
69 sub display_entity ($$$$\$\@);
70 sub display_entity ($$$$\$\@) {
71     my $entity = shift;
72     my $ref = shift;
73     my $top = shift;
74     my $xmessage = shift;
75     my $this = shift;
76     my $attachments = shift;
77
78     my $head = $entity->head;
79     my $disposition = $head->mime_attr('content-disposition');
80     $disposition = 'inline' if not defined $disposition or $disposition eq '';
81     my $type = $entity->effective_type;
82     my $filename = $entity->head->recommended_filename;
83     $filename = '' unless defined $filename;
84     $filename = decode_rfc1522($filename);
85
86     if ($top and not $terse) {
87          my $header = $entity->head;
88          $$this .= "<pre class=\"headers\">\n";
89          if ($trim_headers) {
90               my @headers;
91               foreach (qw(From To Cc Subject Date)) {
92                    my $head_field = $head->get($_);
93                    next unless defined $head_field and $head_field ne '';
94                    push @headers, qq(<b>$_:</b> ) . htmlsanit(decode_rfc1522($head_field));
95               }
96               $$this .= join(qq(), @headers) unless $terse;
97          } else {
98               $$this .= htmlsanit(decode_rfc1522($entity->head->stringify));
99          }
100          $$this .= "</pre>\n";
101     }
102
103     unless (($top and $type =~ m[^text(?:/plain)?(?:;|$)]) or
104             ($type =~ m[^multipart/])) {
105         push @$attachments, $entity;
106         my @dlargs = ($ref, "msg=$xmessage", "att=$#$attachments");
107         push @dlargs, "filename=$filename" if $filename ne '';
108         my $printname = $filename;
109         $printname = 'Message part ' . ($#$attachments + 1) if $filename eq '';
110         $$this .= '<pre class="mime">[<a href="' . bugurl(@dlargs) . qq{">$printname</a> } .
111                   "($type, $disposition)]</pre>\n";
112
113         if ($msg and defined($att) and $att eq $#$attachments) {
114             my $head = $entity->head;
115             chomp(my $type = $entity->effective_type);
116             my $body = $entity->stringify_body;
117             print "Content-Type: $type";
118             my ($charset) = $head->get('Content-Type:') =~ m/charset\s*=\s*\"?([\w-]+)\"?/i;
119             print qq(; charset="$charset") if defined $charset;
120             print "\n";
121             if ($filename ne '') {
122                 my $qf = $filename;
123                 $qf =~ s/"/\\"/g;
124                 $qf =~ s[.*/][];
125                 print qq{Content-Disposition: inline; filename="$qf"\n};
126             }
127             print "\n";
128             my $decoder = new MIME::Decoder($head->mime_encoding);
129             $decoder->decode(new IO::Scalar(\$body), \*STDOUT);
130             exit(0);
131         }
132     }
133
134     return if not $top and $disposition eq 'attachment' and not defined($att);
135     return unless ($type =~ m[^text/?] and
136                    $type !~ m[^text/(?:html|enriched)(?:;|$)]) or
137                   $type =~ m[^application/pgp(?:;|$)] or
138                   $entity->parts;
139
140     if ($entity->is_multipart) {
141         my @parts = $entity->parts;
142         foreach my $part (@parts) {
143             display_entity($part, $ref, 0, $xmessage,
144                            $$this, @$attachments);
145             $$this .= "\n";
146         }
147     } elsif ($entity->parts) {
148         # We must be dealing with a nested message.
149         $$this .= "<blockquote>\n";
150         my @parts = $entity->parts;
151         foreach my $part (@parts) {
152             display_entity($part, $ref, 1, $xmessage,
153                            $$this, @$attachments);
154             $$this .= "\n";
155         }
156         $$this .= "</blockquote>\n";
157     } else {
158          if (not $terse) {
159               my $content_type = $entity->head->get('Content-Type:') || "text/html";
160               my ($charset) = $content_type =~ m/charset\s*=\s*\"?([\w-]+)\"?/i;
161               my $body = $entity->bodyhandle->as_string;
162               $body = convert_to_utf8($body,$charset) if defined $charset;
163               $body = htmlsanit($body);
164               # Add links to URLs
165               $body =~ s,((ftp|http|https)://[\S~-]+?/?)((\&gt\;)?[)]?[']?[:.\,]?(\s|$)),<a href=\"$1\">$1</a>$3,go;
166               # Add links to bug closures
167               $body =~ s[(closes:\s*(?:bug)?\#?\s?\d+(?:,?\s*(?:bug)?\#?\s?\d+)*)
168                         ][my $temp = $1; $temp =~ s{(\d+)}{qq(<a href=").bugurl($1).qq(">$1</a>)}ge; $temp;]gxie;
169               $$this .= qq(<pre class="message">$body</pre>\n);
170          }
171     }
172 }
173
174 my %maintainer = %{getmaintainers()};
175 my %pkgsrc = %{getpkgsrc()};
176
177 my $indexentry;
178 my $showseverity;
179
180 my $tpack;
181 my $tmain;
182
183 $ENV{"TZ"} = 'UTC';
184 tzset();
185
186 my $dtime = strftime "%a, %e %b %Y %T UTC", localtime;
187 $tail_html = $debbugs::gHTMLTail;
188 $tail_html =~ s/SUBSTITUTE_DTIME/$dtime/;
189
190 my %status = %{getbugstatus($ref)};
191 unless (%status) {
192     print <<EOF;
193 Content-Type: text/html; charset=utf-8
194
195 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
196 <html>
197 <head><title>$short - $debbugs::gProject $debbugs::gBug report logs</title></head>
198 <body>
199 <h1>$debbugs::gProject $debbugs::gBug report logs - $short</h1>
200 <p>There is no record of $debbugs::gBug $short.
201 Try the <a href="http://$gWebDomain/">search page</a> instead.</p>
202 $tail_html</body></html>
203 EOF
204     exit 0;
205 }
206
207 $|=1;
208
209 $tpack = lc $status{'package'};
210 my @tpacks = splitpackages($tpack);
211
212 if  ($status{severity} eq 'normal') {
213         $showseverity = '';
214 } elsif (isstrongseverity($status{severity})) {
215         $showseverity = "Severity: <em class=\"severity\">$status{severity}</em>;\n";
216 } else {
217         $showseverity = "Severity: $status{severity};\n";
218 }
219
220 $indexentry .= "<div class=\"msgreceived\">\n";
221 $indexentry .= htmlpackagelinks($status{package}, 0) . ";\n";
222
223 foreach my $pkg (@tpacks) {
224     my $tmaint = defined($maintainer{$pkg}) ? $maintainer{$pkg} : '(unknown)';
225     my $tsrc = defined($pkgsrc{$pkg}) ? $pkgsrc{$pkg} : '(unknown)';
226
227     $indexentry .=
228             htmlmaintlinks(sub { $_[0] == 1 ? "Maintainer for $pkg is\n"
229                                             : "Maintainers for $pkg are\n" },
230                            $tmaint);
231     $indexentry .= ";\nSource for $pkg is\n".
232             '<a href="'.srcurl($tsrc)."\">$tsrc</a>" if ($tsrc ne "(unknown)");
233     $indexentry .= ".\n";
234 }
235
236 $indexentry .= "<br>";
237 $indexentry .= htmladdresslinks("Reported by: ", \&submitterurl,
238                                 $status{originator}) . ";\n";
239 $indexentry .= sprintf "Date: %s.\n",
240                 (strftime "%a, %e %b %Y %T UTC", localtime($status{date}));
241
242 $indexentry .= "<br>Owned by: " . htmlsanit($status{owner}) . ".\n"
243               if length $status{owner};
244
245 $indexentry .= "</div>\n";
246
247 my @descstates;
248
249 $indexentry .= "<h3>$showseverity";
250 $indexentry .= sprintf "Tags: %s;\n", 
251                 htmlsanit(join(", ", sort(split(/\s+/, $status{tags}))))
252                         if length($status{tags});
253 $indexentry .= "<br>" if (length($showseverity) or length($status{tags}));
254
255 my @merged= split(/ /,$status{mergedwith});
256 if (@merged) {
257         my $descmerged = 'Merged with ';
258         my $mseparator = '';
259         for my $m (@merged) {
260                 $descmerged .= $mseparator."<a href=\"" . bugurl($m) . "\">#$m</a>";
261                 $mseparator= ",\n";
262         }
263         push @descstates, $descmerged;
264 }
265
266 if (@{$status{found_versions}}) {
267     my $foundtext = 'Found in ';
268     $foundtext .= (@{$status{found_versions}} == 1) ? 'version ' : 'versions ';
269     $foundtext .= join ', ', map htmlsanit($_), @{$status{found_versions}};
270     push @descstates, $foundtext;
271 }
272
273 if (@{$status{fixed_versions}}) {
274     my $fixedtext = '<strong>Fixed</strong> in ';
275     $fixedtext .= (@{$status{fixed_versions}} == 1) ? 'version ' : 'versions ';
276     $fixedtext .= join ', ', map htmlsanit($_), @{$status{fixed_versions}};
277     if (length($status{done})) {
278         $fixedtext .= ' by ' . htmlsanit(decode_rfc1522($status{done}));
279     }
280     push @descstates, $fixedtext;
281 } elsif (length($status{done})) {
282     push @descstates, "<strong>Done:</strong> ".htmlsanit(decode_rfc1522($status{done}));
283 } elsif (length($status{forwarded})) {
284     push @descstates, "<strong>Forwarded</strong> to ".maybelink($status{forwarded});
285 }
286
287
288 my @blockedby= split(/ /, $status{blockedby});
289 if (@blockedby && $status{"pending"} ne 'fixed' && ! length($status{done})) {
290     for my $b (@blockedby) {
291         my %s = %{getbugstatus($b)};
292         next if $s{"pending"} eq 'fixed' || length $s{done};
293         push @descstates, "Fix blocked by <a href=\"" . bugurl($b) . "\">#$b</a>: ".htmlsanit($s{subject});
294     }
295 }
296
297 my @blocks= split(/ /, $status{blocks});
298 if (@blocks && $status{"pending"} ne 'fixed' && ! length($status{done})) {
299     for my $b (@blocks) {
300         my %s = %{getbugstatus($b)};
301         next if $s{"pending"} eq 'fixed' || length $s{done};
302         push @descstates, "Blocking fix for <a href=\"" . bugurl($b) . "\">#$b</a>: ".htmlsanit($s{subject});
303     }
304 }
305
306 if ($buglog !~ m#^\Q$gSpoolDir/db#) {
307     push @descstates, "Bug is archived. No further changes may be made";
308 }
309
310 $indexentry .= join(";\n<br>", @descstates) . ".\n" if @descstates;
311 $indexentry .= "</h3>\n";
312
313 my $descriptivehead = $indexentry;
314
315 my $buglogfh;
316 if ($buglog =~ m/\.gz$/) {
317     my $oldpath = $ENV{'PATH'};
318     $ENV{'PATH'} = '/bin:/usr/bin';
319     $buglogfh = new IO::File "zcat $buglog |" or &quitcgi("open log for $ref: $!");
320     $ENV{'PATH'} = $oldpath;
321 } else {
322     $buglogfh = new IO::File "<$buglog" or &quitcgi("open log for $ref: $!");
323 }
324
325
326 my @records;
327 eval{
328      @records = read_log_records($buglogfh);
329 };
330 if ($@) {
331      quitcgi("Bad bug log for $debbugs::gBug $ref. Unable to read records: $@");
332 }
333 undef $buglogfh;
334
335 =head2 handle_email_message
336
337      handle_email_message($record->{text},
338                           ref        => $bug_number,
339                           msg_number => $msg_number,
340                          );
341
342 Returns a decoded e-mail message and displays entities/attachments as
343 appropriate.
344
345
346 =cut
347
348 sub handle_email_message{
349      my ($email,%options) = @_;
350
351      my $output = '';
352      my $parser = new MIME::Parser;
353      # Because we are using memory, not tempfiles, there's no need to
354      # clean up here like in Debbugs::MIME
355      $parser->tmp_to_core(1);
356      $parser->output_to_core(1);
357      my $entity = $parser->parse_data( $email);
358      my @attachments = ();
359      display_entity($entity, $options{ref}, 1, $options{msg_number}, $output, @attachments);
360      return $output;
361
362 }
363
364 =head2 bug_links
365
366      bug_links($one_bug);
367      bug_links($starting_bug,$stoping_bugs,);
368
369 Creates a set of links to bugs, starting with bug number
370 $starting_bug, and finishing with $stoping_bug; if only one bug is
371 passed, makes a link to only a single bug.
372
373 The content of the link is the bug number.
374
375 =cut
376
377 sub bug_links{
378      my ($start,$stop,$query_arguments) = @_;
379      $stop = $stop || $start;
380      $query_arguments ||= '';
381      my @output;
382      for my $bug ($start..$stop) {
383           push @output,'<a href="'.bugurl($bug,'').qq(">$bug</a>);
384      }
385      return join(', ',@output);
386 }
387
388 =head2 handle_record
389
390      push @log, handle_record($record,$ref,$msg_num);
391
392 Deals with a record in a bug log as returned by
393 L<Debbugs::Log::read_log_records>; returns the log information that
394 should be output to the browser.
395
396 =cut
397
398 sub handle_record{
399      my ($record,$bug_number,$msg_number,$seen_msg_ids) = @_;
400
401      my $output = '';
402      local $_ = $record->{type};
403      if (/html/) {
404           $output .= decode_rfc1522($record->{text});
405           # Link to forwarded http:// urls in the midst of the report
406           # (even though these links already exist at the top)
407           $output =~ s,((?:ftp|http|https)://[\S~-]+?/?)([\)\'\:\.\,]?(?:\s|\.<|$)),<a href=\"$1\">$1</a>$2,go;
408           # Add links to the cloned bugs
409           $output =~ s{(Bug )(\d+)( cloned as bugs? )(\d+)(?:\-(\d+)|)}{$1.bug_links($2).$3.bug_links($4,$5)}eo;
410           # Add links to merged bugs
411           $output =~ s{(?<=Merged )([\d\s]+)(?=\.)}{join(' ',map {bug_links($_)} (split /\s+/, $1))}eo;
412           # Add links to reassigned packages
413           $output =~ s{(Bug reassigned from package \`)([^\']+)(' to \`)([^\']+)(')}
414           {$1.q(<a href=").pkgurl($2).qq(">$2</a>).$3.q(<a href=").pkgurl($4).qq(">$4</a>).$5}eo;
415           $output .= '<a href="' . bugurl($ref, 'msg='.($msg_number+1)) . '">Full text</a> and <a href="' .
416                bugurl($ref, 'msg='.($msg_number+1), 'mbox') . '">rfc822 format</a> available.';
417
418           $output = qq(<div class="msgreceived">\n<a name="$msg_number">\n) . $output . "</div>\n";
419      }
420      elsif (/recips/) {
421           my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
422           if (defined $msg_id and exists $$seen_msg_ids{$msg_id}) {
423                return ();
424           }
425           elsif (defined $msg_id) {
426                $$seen_msg_ids{$msg_id} = 1;
427           }
428           $output .= qq(<a name="$msg_number">\n);
429           $output .= 'View this message in <a href="' . bugurl($ref, "msg=$msg_number", "mbox") . '">rfc822 format</a>';
430           $output .= handle_email_message($record->{text},
431                                     ref        => $bug_number,
432                                     msg_number => $msg_number,
433                                    );
434      }
435      elsif (/autocheck/) {
436           # Do nothing
437      }
438      elsif (/incoming-recv/) {
439           my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
440           if (defined $msg_id and exists $$seen_msg_ids{$msg_id}) {
441                return ();
442           }
443           elsif (defined $msg_id) {
444                $$seen_msg_ids{$msg_id} = 1;
445           }
446           # Incomming Mail Message
447           my ($received,$hostname) = $record->{text} =~ m/Received: \(at (\S+)\) by (\S+)\;/;
448           $output .= qq|<p class="msgreceived"><a name="$msg_number"><a name="msg$msg_number">Message received</a> at |.
449                htmlsanit("$received\@$hostname") . q| (<a href="| . bugurl($ref, "msg=$msg_number") . '">full text</a>'.q|, <a href="| . bugurl($ref, "msg=$msg_number") . ';mbox=yes">mbox</a>)'.":</p>\n";
450           $output .= handle_email_message($record->{text},
451                                     ref        => $bug_number,
452                                     msg_number => $msg_number,
453                                    );
454      }
455      else {
456           die "Unknown record type $_";
457      }
458      return $output;
459 }
460
461 my $log='';
462 my $msg_num = 0;
463 my $skip_next = 0;
464 if (looks_like_number($msg) and ($msg-1) <= $#records) {
465      @records = ($records[$msg-1]);
466      $msg_num = $msg - 1;
467 }
468 my @log;
469 if ( $mbox ) {
470      my $date = strftime "%a %b %d %T %Y", localtime;
471      if (@records > 1) {
472           print qq(Content-Disposition: attachment; filename="bug_${ref}.mbox"\n);
473           print "Content-Type: text/plain\n\n";
474      }
475      else {
476           $msg_num++;
477           print qq(Content-Disposition: attachment; filename="bug_${ref}_message_${msg_num}.mbox"\n);
478           print "Content-Type: message/rfc822\n\n";
479      }
480      if ($mbox_status_message and @records > 1) {
481           my $status_message='';
482           my @status_fields = (retitle   => 'subject',
483                                package   => 'package',
484                                submitter => 'originator',
485                                severity  => 'severity',
486                                tag       => 'tags',
487                                owner     => 'owner',
488                                blocks    => 'blocks',
489                                forward   => 'forward',
490                               );
491           my ($key,$value);
492           while (($key,$value) = splice(@status_fields,0,2)) {
493                if (defined $status{$value} and length $status{$value}) {
494                     $status_message .= qq($key $ref $status{$value}\n);
495                }
496           }
497           print STDOUT qq(From unknown $date\n),
498                create_mime_message([From       => "$debbugs::gBug#$ref <$ref\@$debbugs::gEmailDomain>",
499                                     To         => "$debbugs::gBug#$ref <$ref\@$debbugs::gEmailDomain>",
500                                     Subject    => "Status: $status{subject}",
501                                     "Reply-To" => "$debbugs::gBug#$ref <$ref\@$debbugs::gEmailDomain>",
502                                    ],
503                                    <<END,);
504 $status_message
505 thanks
506
507
508 END
509      }
510      my $message_number=0;
511      my %seen_message_ids;
512      for my $record (@records) {
513           next if $record->{type} !~ /^(?:recips|incoming-recv)$/;
514           my $wanted_type = $mbox_maint?'recips':'incoming-recv';
515           # we want to include control messages anyway
516           my $record_wanted_anyway = 0;
517           my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
518           next if exists $seen_message_ids{$msg_id};
519           $seen_message_ids{$msg_id} = 1;
520           next if $msg_id =~/handler\..+\.ack(?:info)?\@/;
521           $record_wanted_anyway = 1 if $record->{text} =~ /^Received: \(at control\)/;
522           next if not $boring and $record->{type} ne $wanted_type and not $record_wanted_anyway and @records > 1;
523           my @lines = split( "\n", $record->{text}, -1 );
524           if ( $lines[ 1 ] =~ m/^From / ) {
525                my $tmp = $lines[ 0 ];
526                $lines[ 0 ] = $lines[ 1 ];
527                $lines[ 1 ] = $tmp;
528           }
529           if ( !( $lines[ 0 ] =~ m/^From / ) ) {
530                unshift @lines, "From unknown $date";
531           }
532           map { s/^(>*From )/>$1/ } @lines[ 1 .. $#lines ];
533           print join( "\n", @lines ) . "\n";
534      }
535      exit 0;
536 }
537
538 else {
539      my %seen_msg_ids;
540      for my $record (@records) {
541           $msg_num++;
542           if ($skip_next) {
543                $skip_next = 0;
544                next;
545           }
546           $skip_next = 1 if $record->{type} eq 'html' and not $boring;
547           push @log, handle_record($record,$ref,$msg_num,\%seen_msg_ids);
548      }
549 }
550
551 @log = reverse @log if $reverse;
552 $log = join('<hr>',@log);
553
554
555 print "Content-Type: text/html; charset=utf-8\n\n";
556
557 my $title = htmlsanit($status{subject});
558
559 my $dummy2 = $debbugs::gWebHostBugDir;
560
561 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
562 print "<HTML><HEAD>\n" . 
563     "<TITLE>$short - $title - $debbugs::gProject $debbugs::gBug report logs</TITLE>\n" .
564      '<meta http-equiv="Content-Type" content="text/html;charset=utf-8">'.
565      "<link rel=\"stylesheet\" href=\"$debbugs::gWebHostBugDir/css/bugs.css\" type=\"text/css\">" .
566     "</HEAD>\n" .
567     '<BODY>' .
568     "\n";
569 print "<H1>" . "$debbugs::gProject $debbugs::gBug report logs - <A HREF=\"mailto:$ref\@$gEmailDomain\">$short</A>" .
570       "<BR>" . $title . "</H1>\n";
571
572 print "$descriptivehead\n";
573 printf qq(<div class="msgreceived"><p>View this report as an <a href="%s">mbox folder</a>,).
574      qq(<a href="%s">status mbox</a>, <a href="%s">maintainer mbox</a></p></div>\n),
575      html_escape(bug_url($ref, mbox=>'yes')),
576      html_escape(bug_url($ref, mbox=>'yes',mboxstatus=>'yes')),
577      html_escape(bug_url($ref, mbox=>'yes',mboxmaint=>'yes'));
578 print "<HR>";
579 print "$log";
580 print "<HR>";
581 print "<p class=\"msgreceived\">Send a report that <a href=\"/cgi-bin/bugspam.cgi?bug=$ref\">this bug log contains spam</a>.</p>\n<HR>\n";
582 print $tail_html;
583
584 print "</BODY></HTML>\n";
585
586 exit 0;