2 # $Id: process.in,v 1.22 2000/11/22 10:02:51 joy Exp $
8 require( '/etc/debbugs/config' );
9 require( '/usr/lib/debbugs/errorlib' );
10 chdir( "$gSpoolDir" ) || die 'chdir spool: $!\n';
12 #open(DEBUG,"> /tmp/debbugs.debug");
13 open DEBUG, ">/dev/null";
15 defined( $intdate= time ) || &quit( "failed to get time: $!" );
18 m/^([BMQFDU])(\d*)\.\d+$/ || &quit("bad argument");
20 $tryref= length($2) ? $2+0 : -1;
23 if (!rename("incoming/G$nn","incoming/P$nn"))
24 { $_=$!.''; m/no such file or directory/i && exit 0;
25 &quit("renaming to lock: $!");
28 $baddress= 'bugs' if $codeletter eq 'B';
29 $baddress= 'maintonly' if $codeletter eq 'M';
30 $baddress= 'quiet' if $codeletter eq 'Q';
31 $baddress= 'forwarded' if $codeletter eq 'F';
32 $baddress= 'done' if $codeletter eq 'D';
33 $baddress= 'submitter' if $codeletter eq 'U';
34 $baddress || &quit("bad codeletter $codeletter");
35 $baddressroot= $baddress;
36 $baddress= "$tryref-$baddress" if $tryref>=0;
38 open(M,"incoming/P$nn");
45 print DEBUG "###\n",join("##\n",@msg),"\n###\n";
47 chop($tdate= `date -u '+%a, %d %h %Y %T GMT'`);
49 X-Loop: $gMaintainerEmail
50 Received: via spool by $baddress\@$gEmailDomain id=$nn
51 (code $codeletter ref $tryref); $tdate
54 # Process the message's mail headers
55 for ($i=0; $i<=$#msg; $i++) {
57 last unless length($_);
58 &quit("looping detected") if m/^x-loop: (\S+)$/i && $1 eq "$gMaintainerEmail";
59 $ins= !m/^subject:/i && !m/^reply-to:/i && !m/^return-path:/i
60 && !m/^From / && !m/^X-Debbugs-CC:/i && !m/^received:/i;
61 $fwd .= $_."\n" if $ins;
62 while ($msg[$i+1] =~ m/^\s/) {
64 $fwd .= $msg[$i]."\n" if $ins;
67 # print DEBUG ">$_<\n";
69 $v= $1; $v =~ y/A-Z/a-z/;
70 print DEBUG ">$v=$_<\n";
73 print DEBUG "!>$_<\n";
78 while ($i <= $#msg && !length($msg[$i])) { $fwd .= "\n"; $i++; }
80 #skips the "this is mime" message and any blank space after it
81 if ( $msg[$i] =~ /^This is a multi-part message in MIME format./ )
83 while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i] . "\n"; $i++; }
84 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
86 #if the lines starts with -- or is nothing but blank space...
87 #skip to the next blank line(s) then skip past the blank line(s)
88 if ( $msg[$i] =~ /^--/ || $msg[$i] =~ /^\s*$/ )
90 while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i] . "\n"; $i++; }
91 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
94 while (defined ($msg[$i] ) )
96 last if ( $msg[$i] !~ m/^([\w]+):\s*(\S+)(.*)/ );
99 print DEBUG ">$fn|$'|\n";
100 $fwd .= $fn.': '.$fv."\n";
104 $pfullheader{$fn}= $2.$3;
105 print DEBUG ">$fn~$fv<\n";
109 $fwd .= join("\n",@msg[$i..$#msg]);
111 print DEBUG "***\n$fwd\n***\n";
113 defined($header{'from'}) || &quit("no From header");
114 $replyto= defined($header{'reply-to'}) ? $header{'reply-to'} : $header{'from'};
117 $_= "$2 <$1>" if m/^([^\<\> \t\n\(\)]+) \(([^\(\)\<\>]+)\)$/;
119 print DEBUG "replytocompare >$replytocompare<\n";
121 if (!defined($header{'subject'}))
122 { $brokenness.= <<END;
124 Your message did not contain a Subject field. This is broken, I am
125 afraid - the Subject: line is a Required Header according to RFC822.
126 Please remember to include a Subject field in your messages in future.
127 If you did so the fact that it got lost probably indicates a poorly
128 configured mail system at your site or an intervening one.
130 $subject= '(no subject)';
131 } else { $subject= $header{'subject'}; }
134 $subject =~ s/^Re:\s*//i; $_= $subject."\n";
135 if ($tryref < 0 && m/^Bug ?\#(\d+)\D/i) { $tryref= $1+0; }
138 { $bfound= &lockreadbugmerge($tryref);
139 if ($bfound) { $ref= $tryref; }
141 { &htmllog("Reply","sent", $replyto,"Unknown problem report number <code>$tryref</code>.");
142 &sendmessage(<<END, '');
143 From: $gMaintainerEmail ($gProject $gBug Tracking System)
145 Subject: Unknown problem report $gBug#$tryref ($subject)
146 Message-ID: <handler.x.$nn.unknown\@$gEmailDomain>
147 In-Reply-To: $header{'message-id'}
148 References: $header{'message-id'} $s_msgid
149 X-$gProject-PR-Message: error
151 You sent a message to the $gBug tracking system which gave (in the
152 Subject line or encoded into the recipient at $gEmailDomain),
153 the number of a nonexistent $gBug report (#$tryref).
155 This may be because that $gBug report has been resolved for more than $gRemoveAge
156 days, and the record of it has been expunged, or because you mistyped
157 the $gBug report number.
159 Your message was dated $header{'date'} and was sent to
160 $baddress\@$gEmailDomain. It had
161 Message-ID $header{'message-id'}
162 and Subject $subject.
164 It has been filed (under junk) but otherwise ignored.
166 Please consult your records to find the correct $gBug report number, or
167 contact me, the system administrator, for assistance.
170 (administrator, $gProject $gBugs database)
172 (NB: If you are a system administrator and have no idea what I am
173 talking about this indicates a serious mail system misconfiguration
174 somewhere. Please contact me immediately.)
180 } else { &filelock('lock/-1'); }
182 if ($codeletter eq 'D' || $codeletter eq 'F')
183 { if ($replyto =~ m/$gBounceFroms/o ||
184 $header{'from'} =~ m/$gBounceFroms/o)
185 { &quit("bounce detected ! Mwaap! Mwaap!"); }
186 $markedby= $header{'from'} eq $replyto ? $replyto :
187 "$header{'from'} (reply to $replyto)";
188 if ($codeletter eq 'F')
189 { (&appendlog,&finish) if length($s_forwarded);
190 $receivedat= "forwarded\@$gEmailDomain";
191 $markaswhat= 'forwarded';
192 $set_forwarded= $header{'to'};
193 if ( length( $gListDomain ) > 0 && length( $gFowardList ) > 0 )
194 { $generalcc= "$gFowardList\@$gListDomain"; }
195 else { $generalcc=''; }
197 { (&appendlog,&finish) if length($s_done);
198 $receivedat= "done\@$gEmailDomain";
200 $set_done= $header{'from'};
201 if ( length( $gListDomain ) > 0 && length( $gDoneList ) > 0 )
202 { $generalcc= "$gDoneList\@$gListDomain"; }
203 else { $generalcc=''; }
206 { &htmllog("Warning","sent",$replyto,"Message ignored.");
207 &sendmessage(<<END, '');
208 From: $gMaintainerEmail ($gProject $gBug Tracking System)
210 Subject: Message with no $gBug number ignored by $receivedat
212 Message-ID: <header.x.$nn.warnignore\@$gEmailDomain>
213 In-Reply-To: $header{'message-id'}
214 References: $header{'message-id'} $s_msgid
215 X-$gProject-PR-Message: error
217 You sent a message to the $gProject $gBug tracking system old-style
218 unified mark as $markaswhat address ($receivedat),
219 without a recognisable $gBug number in the Subject.
220 Your message has been filed under junk but otherwise ignored.
222 If you don't know what I'm talking about then probably either:
224 (a) you unwittingly sent a message to done\@$gEmailDomain
225 because you replied to all recipients of the message a developer used
226 to mark a $gBug as done and you modified the Subject. In this case,
227 please do not be alarmed. To avoid confusion do not do it again, but
228 there is no need to apologise or mail anyone asking for an explanation.
230 (b) you are a system administrator, reading this because the $gBug
231 tracking system is responding to a misdirected bounce message. In this
232 case there is a serious mail system misconfiguration somewhere - please
233 contact me immediately.
235 Your message was dated $header{'date'} and had
236 message-id $header{'message-id'}
237 and subject $subject.
239 If you need any assistance or explanation please contact me.
242 (administrator, $gProject $gBugs database)
249 $noticeccval.= join(', ', grep($_ ne $replyto,@maintaddrs));
250 $noticeccval =~ s/\s+\n\s+/ /g; $noticeccval =~ s/^\s+/ /; $noticeccval =~ s/\s+$//;
251 if (length($noticeccval)) { $noticecc= "Cc: $noticeccval\n"; }
252 if (length($generalcc)) { $noticecc.= "Bcc: $generalcc\n"; }
253 @process= ($ref,split(/ /,$s_mergedwith));
256 { if ($ref != $orgref)
258 &lockreadbug($ref) || die "huh ? $ref from $orgref out of @process";
260 $s_done= $set_done if defined($set_done);
261 $s_forwarded= $set_forwarded if defined($set_forwarded);
262 &overwrite("db/$ref.status",
263 "$s_originator\n$s_date\n$s_subject\n$s_msgid\n".
264 "$s_package\n$s_keywords\n$s_done\n$s_forwarded\n$s_mergedwith\n$s_severity\n");
265 open(O,"db/$ref.report") || &quit("read original report: $!");
266 $x= join('',<O>); close(O);
267 if ($codeletter eq 'F')
268 { &htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
269 &sendmessage(<<END, '');
270 From: $gMaintainerEmail ($gProject $gBug Tracking System)
272 ${noticecc}Subject: $gBug#$ref: marked as forwarded ($s_subject)
273 Message-ID: <header.$ref.$nn.ackfwdd\@$gEmailDomain>
274 In-Reply-To: $header{'message-id'}
275 References: $header{'message-id'} $s_msgid
276 X-$gProject-PR-Message: forwarded $ref
278 Your message dated $header{'date'}
279 with message-id $header{'message-id'}
280 has caused the $gProject $gBug report #$ref,
282 to be marked as having been forwarded to the upstream software
283 author(s) $s_forwarded.
285 (NB: If you are a system administrator and have no idea what I am
286 talking about this indicates a serious mail system misconfiguration
287 somewhere. Please contact me immediately.)
290 (administrator, $gProject $gBugs database)
294 { &htmllog("Reply","sent",$replyto,"You have taken responsibility.");
295 &sendmessage(<<END."--------------------------------------\n".$x."---------------------------------------\n".join( "\n", @msg ), '');
296 From: $gMaintainerEmail ($gProject $gBug Tracking System)
298 ${noticecc}Subject: $gBug#$ref: marked as done ($s_subject)
299 Message-ID: <handler.$ref.$nn.ackdone\@$gEmailDomain>
300 In-Reply-To: $header{'message-id'}
301 References: $header{'message-id'} $s_msgid
302 X-$gProject-PR-Message: closed $ref
304 Your message dated $header{'date'}
305 with message-id $header{'message-id'}
306 and subject line $subject
307 has caused the attached $gBug report to be marked as done.
309 This means that you claim that the problem has been dealt with.
310 If this is not the case it is now your responsibility to reopen the
311 $gBug report if necessary, and/or fix the problem forthwith.
313 (NB: If you are a system administrator and have no idea what I am
314 talking about this indicates a serious mail system misconfiguration
315 somewhere. Please contact me immediately.)
318 (administrator, $gProject $gBugs database)
321 &htmllog("Notification","sent",$s_originator,
322 "$gBug acknowledged by developer.");
323 &sendmessage(<<END.join("\n",@msg),'');
324 From: $gMaintainerEmail ($gProject $gBug Tracking System)
326 Subject: $gBug#$ref acknowledged by developer
328 Message-ID: <handler.$ref.$nn.notifdone\@$gEmailDomain>
329 In-Reply-To: $s_msgid
330 References: $header{'message-id'} $s_msgid
331 X-$gProject-PR-Message: they-closed $ref
333 This is an automatic notification regarding your $gBug report
335 which was filed against the $s_package package.
337 It has been closed by one of the developers, namely
340 Their explanation is attached below. If this explanation is
341 unsatisfactory and you have not received a better one in a separate
342 message then please contact the developer directly, or email
343 $ref\@$gEmailDomain or me.
346 (administrator, $gProject $gBugs database)
356 { if ($codeletter eq 'U')
357 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
358 &sendmessage(<<END, '');
359 From: $gMaintainerEmail ($gProject $gBug Tracking System)
361 Subject: Message with no $gBug number cannot be sent to submitter !
363 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
364 In-Reply-To: $header{'message-id'}
365 References: $header{'message-id'} $s_msgid
366 X-$gProject-PR-Message: error
368 You sent a message to the $gProject $gBug tracking system send to $gBug
369 report submitter address $baddress\@$gEmailDomain, without a
370 recognisable $gBug number in the Subject. Your message has been filed
371 under junk but otherwise ignored.
373 If you don't know what I'm talking about then probably either:
375 (a) you unwittingly sent a message to $baddress\@$gEmailDomain
376 because you replied to all recipients of the message a developer sent
377 to a $gBug's submitter and you modified the Subject. In this case,
378 please do not be alarmed. To avoid confusion do not do it again, but
379 there is no need to apologise or mail anyone asking for an
382 (b) you are a system administrator, reading this because the $gBug
383 tracking system is responding to a misdirected bounce message. In this
384 case there is a serious mail system misconfiguration somewhere - please
385 contact me immediately.
387 Your message was dated $header{'date'} and had
388 message-id $header{'message-id'}
389 and subject $subject.
391 If you need any assistance or explanation please contact me.
394 (administrator, $gProject $gBugs database)
400 if (!defined($pheader{'package'}))
401 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
402 &sendmessage(<<END."---------------------------------------------------------------------------\n".join("\n", @msg), '');
403 From: $gMaintainerEmail ($gProject $gBug Tracking System)
405 Subject: Message with no Package: tag cannot be processed!
407 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
408 In-Reply-To: $header{'message-id'}
409 References: $header{'message-id'} $s_msgid
410 X-$gProject-PR-Message: error
412 Your message didn't have a Package: line at the start (in the
413 pseudo-header following the real mail header), or didn't have a
414 pseudo-header at all.
416 This makes it much harder for us to categorise and deal with your
417 problem report. Please _resubmit_ your report and tell us which package
418 the report is on. For help, check out http://$gWebDomain/Reporting.html.
420 Your message was dated $header{'date'} and had
421 message-id $header{'message-id'}
422 and subject $subject.
423 The complete text of it is attached to this message.
425 If you need any assistance or explanation please contact me.
428 (administrator, $gProject $gBugs database)
433 } else { $s_package= $pheader{'package'}; }
435 if (defined($pheader{'keywords'})) {
436 $s_keywords= $pfullheader{'keywords'};
437 } elsif (defined($pheader{'tags'})) {
438 $s_keywords= $pfullheader{'tags'};
440 if (length($s_keywords)) {
442 my %gkws = map { (%_, 1) } @gTags;
443 foreach my $kw (sort split(/[,\s]+/, lc($s_keywords))) {
444 push @kws, $kw if (defined $gkws{$kw});
446 $s_keywords = join(" ", @kws);
449 if (defined($pheader{'severity'}) || defined($pheader{'priority'}))
450 { $s_severity= $pheader{'severity'};
451 $s_severity= $pheader{'priority'} unless ($s_severity);
453 if (!grep($_ eq $s_severity, @severities, "$gDefaultSeverity")) {
456 Your message specified a Severity: in the pseudo-header, but
457 the severity value $s_severity was not recognised.
458 The default severity $gDefaultSeverity is being used instead.
459 The recognised values are: $gShowSeverities.
461 # if we use @gSeverityList array in the above line, perl -c gives:
462 # In string, @gSeverityList now must be written as \@gSeverityList at
463 # process line 452, near "$gDefaultSeverity is being used instead.
467 &filelock("nextnumber.lock");
468 open(N,"nextnumber") || &quit("nextnumber: read: $!");
469 $v=<N>; $v =~ s/\n$// || &quit("nextnumber bad format");
470 $ref= $v+0; $v += 1; $newref=1;
471 &overwrite('nextnumber', "$v\n");
473 &overwrite("db/$ref.log",'');
474 &overwrite("db/$ref.status",
475 "$replyto\n$intdate\n$subject\n$header{'message-id'}\n".
476 "$s_package\n$s_keywords\n\n\n\n$s_severity\n");
477 &overwrite("db/$ref.report",
478 join("\n",@msg)."\n");
483 print DEBUG "maintainers >@maintaddrs<\n";
485 $orgsender= defined($header{'sender'}) ? "Orignal-Sender: $header{'sender'}\n" : '';
486 $newsubject= $subject; $newsubject =~ s/^$gBug#$ref\W*\s*//;
488 $xcchdr= $header{ 'x-debbugs-cc' };
489 if ($xcchdr =~ m/\S/) {
490 push(@resentccs,$xcchdr);
491 $resentccexplain.= <<END;
493 As you requested using X-Debbugs-CC, your message was also forwarded to
495 (after having been given a $gBug report number, if it did not have one).
499 if (@maintaddrs && ($codeletter eq 'B' || $codeletter eq 'M')) {
500 push(@resentccs,@maintaddrs);
501 $resentccexplain.= <<END." ".join("\n ",@maintaddrs)."\n";
503 Your message has been sent to the package maintainer(s):
507 $veryquiet= $codeletter eq 'Q';
508 if ($codeletter eq 'M' && !@maintaddrs) {
512 You requested that the message be sent to the package maintainer(s)
513 but either the $gBug report is not associated with any package (probably
514 because of a missing Package pseudo-header field in the original $gBug
515 report), or the package(s) specified do not have any maintainer(s).
517 Your message has *not* been sent to any package maintainers; it has
518 merely been filed in the $gBug tracking system. If you require assistance
519 please contact $gMaintainerEmail quoting the $gBug number $ref.
523 $resentccval.= join(', ',@resentccs);
524 $resentccval =~ s/\s+\n\s+/ /g; $resentccval =~ s/^\s+/ /; $resentccval =~ s/\s+$//;
525 if (length($resentccval)) { $resentcc= "Resent-CC: $resentccval\n"; }
527 if ($codeletter eq 'U') {
528 &htmllog("Message", "sent on", $s_originator, "$gBug#$ref.");
529 &sendmessage(<<END,$s_originator,@resentccs);
530 Subject: $gBug#$ref: $newsubject
531 Reply-To: $replyto, $ref-quiet\@$gEmailDomain
532 ${orgsender}Resent-To: $s_originator
533 ${resentcc}Resent-Date: $tdate
534 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
535 Resent-Sender: $gMaintainerEmail
536 X-$gProject-PR-Message: report $ref
537 X-$gProject-PR-Package: $s_package
540 } elsif ($codeletter eq 'B') {
541 &htmllog($newref ? "Report" : "Information", "forwarded",
542 join(', ',"$gSubmitList\@$gListDomain",@resentccs),
543 "<code>$gBug#$ref</code>".
544 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
546 &sendmessage(<<END,"$gSubmitList\@$gListDomain",@resentccs);
547 Subject: $gBug#$ref: $newsubject
548 Reply-To: $replyto, $ref\@$gEmailDomain
549 Resent-From: $header{'from'}
550 ${orgsender}Resent-To: $gSubmitList\@$gListDomain
551 ${resentcc}Resent-Date: $tdate
552 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
553 Resent-Sender: $gMaintainerEmail
554 X-$gProject-PR-Message: report $ref
555 X-$gProject-PR-Package: $s_package
558 } elsif (@resentccs) {
559 # D and F done far earlier; B just done - so this must be M or Q
560 # We preserve whichever it was in the Reply-To (possibly adding
562 &htmllog($newref ? "Report" : "Information", "forwarded",
564 "<code>$gBug#$ref</code>".
565 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
567 &sendmessage(<<END,@resentccs);
568 Subject: $gBug#$ref: $newsubject
569 Reply-To: $replyto, $ref-$baddressroot\@$gEmailDomain
570 Resent-From: $header{'from'}
571 ${orgsender}Resent-To: $resentccval
573 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
574 Resent-Sender: $gMaintainerEmail
575 X-$gProject-PR-Message: report $ref
576 X-$gProject-PR-Package: $s_package
581 $htmlbreak= length($brokenness) ? "<p>\n".&sani($brokenness)."\n<p>\n" : '';
582 $htmlbreak =~ s/\n\n/\n<P>\n\n/g;
583 if (length($resentccval)) {
585 " Copy sent to <code>".&sani($resentccval)."</code>.".
589 &htmllog("Acknowledgement","sent",$replyto,
591 "New $gBug report received and filed, but not forwarded." :
592 "New $gBug report received and forwarded."). $htmlbreak);
593 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
594 From: $gMaintainerEmail ($gProject $gBug Tracking System)
596 Subject: $gBug#$ref: Acknowledgement of QUIET report
598 Message-ID: <handler.$ref.$nn.ackquiet\@$gEmailDomain>
599 In-Reply-To: $header{'message-id'}
600 References: $header{'message-id'}
601 X-$gProject-PR-Message: ack-quiet $ref
603 Thank you for the problem report you have sent regarding $gProject.
604 This is an automatically generated reply, to let you know your message
605 has been received. It has not been forwarded to the developers or
606 their mailing list; you should ensure that the developers are aware of
607 the problem you have entered into the system - preferably quoting the
608 $gBug reference number, #$ref.
610 If you wish to submit further information on your problem, please send it
611 to $ref-$baddressroot\@$gEmailDomain (and *not*
612 to $baddress\@$gEmailDomain).
614 Please do not reply to the address at the top of this message,
615 unless you wish to report a problem with the $gBug-tracking system.
618 (administrator, $gProject $gBugs database)
620 From: $gMaintainerEmail ($gProject $gBug Tracking System)
622 Subject: $gBug#$ref: Acknowledgement of maintainer-only report
624 Message-ID: <handler.$ref.$nn.ackmaint\@$gEmailDomain>
625 In-Reply-To: $header{'message-id'}
626 References: $header{'message-id'}
627 X-$gProject-PR-Message: ack-maintonly $ref
629 Thank you for the problem report you have sent regarding $gProject.
630 This is an automatically generated reply, to let you know your message has
631 been received. It is being forwarded to the developers (but not the mailing
632 list, as you requested) for their attention; they will reply in due course.
634 If you wish to submit further information on your problem, please send
635 it to $ref-$baddressroot\@$gEmailDomain (and *not*
636 to $baddress\@$gEmailDomain).
638 Please do not reply to the address at the top of this message,
639 unless you wish to report a problem with the $gBug-tracking system.
642 (administrator, $gProject $gBugs database)
644 From: $gMaintainerEmail ($gProject $gBug Tracking System)
646 Subject: $gBug#$ref: Acknowledgement ($subject)
647 Message-ID: <handler.$ref.$nn.ack\@$gEmailDomain>
648 In-Reply-To: $header{'message-id'}
649 References: $header{'message-id'}
650 X-$gProject-PR-Message: ack $ref
652 Thank you for the problem report you have sent regarding $gProject.
653 This is an automatically generated reply, to let you know your message has
654 been received. It is being forwarded to the developers mailing list for
655 their attention; they will reply in due course.
657 If you wish to submit further information on your problem, please send
658 it to $ref\@$gEmailDomain (and *not* to
659 $baddress\@$gEmailDomain).
661 Please do not reply to the address at the top of this message,
662 unless you wish to report a problem with the $gBug-tracking system.
665 (administrator, $gProject $gBugs database)
667 } elsif ($codeletter ne 'U') {
668 &htmllog("Acknowledgement","sent",$replyto,
669 ($veryquiet ? "Extra info received and filed, but not forwarded." :
670 $codeletter eq 'M' ? "Extra info received and forwarded to maintainer." :
671 "Extra info received and forwarded to list."). $htmlbreak);
672 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
673 From: $gMaintainerEmail ($gProject $gBug Tracking System)
675 Subject: $gBug#$ref: Info received and FILED only
677 Message-ID: <handler.$ref.$nn.ackinfoquiet\@$gEmailDomain>
678 In-Reply-To: $header{'message-id'}
679 References: $header{'message-id'}
680 X-$gProject-PR-Message: ack-info-quiet $ref
682 Thank you for the additional information you have supplied regarding
683 this problem report. It has NOT been forwarded to the developers, but
684 will accompany the original report in the $gBug tracking system. Please
685 ensure that you yourself have sent a copy of the additional
686 information to any relevant developers or mailing lists.
688 If you wish to continue to submit further information on your problem,
689 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
691 Please do not reply to the address at the top of this message,
692 unless you wish to report a problem with the $gBug-tracking system.
695 (administrator, $gProject $gBugs database)
697 From: $gMaintainerEmail ($gProject $gBug Tracking System)
699 Subject: $gBug#$ref: Info received for maintainer only
701 Message-ID: <handler.$ref.$nn.ackinfomaint\@$gEmailDomain>
702 In-Reply-To: $header{'message-id'}
703 References: $header{'message-id'}
704 X-$gProject-PR-Message: ack-info $ref
706 Thank you for the additional information you have supplied regarding
707 this problem report. It has been forwarded to the developer(s) (but
708 not to the mailing list) to accompany the original report.
710 If you wish to continue to submit further information on your problem,
711 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
713 Please do not reply to the address at the top of this message,
714 unless you wish to report a problem with the $gBug-tracking system.
717 (administrator, $gProject $gBugs database)
719 From: $gMaintainerEmail ($gProject $gBug Tracking System)
721 Subject: $gBug#$ref: Info received (was $subject)
722 Message-ID: <handler.$ref.$nn.ackinfo\@$gEmailDomain>
723 In-Reply-To: $header{'message-id'}
724 References: $header{'message-id'}
725 X-$gProject-PR-Message: ack-info-maintonly $ref
727 Thank you for the additional information you have supplied regarding
728 this problem report. It has been forwarded to the developer(s) and
729 to the developers mailing list to accompany the original report.
731 If you wish to continue to submit further information on your problem,
732 please send it to $ref\@$gEmailDomain, as before.
734 Please do not reply to the address at the top of this message,
735 unless you wish to report a problem with the $gBug-tracking system.
738 (administrator, $gProject $gBugs database)
747 open(NEW,">$f.new") || &quit("$f.new: create: $!");
748 print(NEW "$v") || &quit("$f.new: write: $!");
749 close(NEW) || &quit("$f.new: close: $!");
750 rename("$f.new","$f") || &quit("rename $f.new to $f: $!");
754 if (!open(AP,">>db/$ref.log")) {
755 print DEBUG "failed open log<\n";
756 print DEBUG "failed open log err $!<\n";
757 &quit("opening db/$ref.log (li): $!");
759 print(AP "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log (li): $!");
760 close(AP) || &quit("closing db/$ref.log (li): $!");
764 utime(time,time,"db");
766 while ($u= $cleanups[$#cleanups]) { &$u; }
767 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
771 &quit("wot no exit");
773 sub chldhandle { $chldexit = 'yes'; }
776 local ($whatobj,$whatverb,$where,$desc) = @_;
777 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lh): $!");
780 "<strong>$whatobj $whatverb</strong> to <code>".&sani($where).
781 "</code>:<br>\n". $desc.
782 "\n\3\n") || &quit("writing db/$ref.log (lh): $!");
783 close(AP) || &quit("closing db/$ref.log (lh): $!");
788 map { $_->address() }
789 map { Mail::Address->parse($_) } @_;
794 local ($msg,@recips) = @_;
795 if ($recips[0] eq '' && $#recips == 0) { @recips= ('-t'); }
797 #save email to the log
798 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lo): $!");
799 print(AP "\2\n",join("\4",@recips),"\n\5\n$msg\n\3\n") ||
800 &quit("writing db/$ref.log (lo): $!");
801 close(AP) || &quit("closing db/$ref.log (lo): $!");
803 #if debbuging.. save email to a log
804 # open AP, ">>debug";
805 # print AP join( '|', @recips )."\n>>";
806 # print AP get_addresses( @recips );
807 # print AP "<<\n".$msg;
808 # print AP "\n--------------------------------------------------------\n";
813 $SIG{'CHLD'}='chldhandle';
814 #print DEBUG "mailing sigchild set up<\n";
817 #print DEBUG "mailing opened pipe fork<\n";
818 defined($c) || die $!;
819 #print DEBUG "mailing opened pipe fork ok $c<\n";
820 if (!$c) { # ie, we are in the child process
821 #print DEBUG "mailing child<\n";
822 unless (open(STDERR,">&STDOUT")) {
823 #print DEBUG "mailing child opened stderr<\n";
824 print STDOUT "redirect stderr: $!\n";
825 #print DEBUG "mailing child opened stderr fail<\n";
827 #print DEBUG "mailing child opened stderr fail exit !?<\n";
829 #print DEBUG "mailing child opened stderr ok<\n";
831 #print DEBUG "mailing child forked again<\n";
832 defined($c) || die $!;
833 #print DEBUG "mailing child forked again ok $c<\n";
834 if (!$c) { # ie, we are the child process
835 #print DEBUG "mailing grandchild<\n";
836 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
837 #print DEBUG "mailing grandchild exec failed<\n";
839 #print DEBUG "mailing grandchild died !?<\n";
841 #print DEBUG "mailing child not grandchild<\n";
842 print(D $msg) || die $!;
843 #print DEBUG "mailing child printed msg<\n";
845 #print DEBUG "mailing child closed pipe<\n";
846 die "\n*** command returned exit status $?\n" if $?;
847 #print DEBUG "mailing child exit status ok<\n";
849 #print DEBUG "mailing child exited ?!<\n";
851 #print DEBUG "mailing parent<\n";
853 #print DEBUG "mailing parent results emptied<\n";
854 while( $chldexit eq 'no' ) { $results.= $_; }
855 #print DEBUG "mailing parent results read >$results<\n";
857 #print DEBUG "mailing parent results closed<\n";
858 $results.= "\n*** child returned exit status $?\n" if $?;
859 #print DEBUG "mailing parent exit status ok<\n";
860 $SIG{'CHLD'}='DEFAULT';
861 #print DEBUG "mailing parent sigchild default<\n";
862 if (length($results)) { &quit("running sendmail: $results"); }
863 #print DEBUG "mailing parent results ok<\n";
866 sub checkmaintainers {
867 return if $maintainerschecked++;
868 return if !length($s_package);
869 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
873 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
874 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
875 $maintainerof{$1}= $2;
878 $anymaintfound=0; $anymaintnotfound=0;
879 for $p (split(m/[ \t?,()]+/,$s_package)) {
881 if (defined($maintainerof{$p})) {
882 print DEBUG "maintainer add >$p|$maintainerof{$p}<\n";
883 $addmaint= $maintainerof{$p};
884 push(@maintaddrs,$addmaint) unless
885 $addmaint eq $replyto || grep($_ eq $addmaint, @maintaddrs);
888 print DEBUG "maintainer none >$p<\n";