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