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