2 # $Id: process.in,v 1.26 2001/03/18 05:13:52 doogie 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 print DEBUG ">$fn~$fv<\n";
108 $fwd .= join("\n",@msg[$i..$#msg]);
110 print DEBUG "***\n$fwd\n***\n";
112 if (defined $header{'resent-from'} && !defined $header{'from'}) {
113 $header{'from'} = $header{'resent-from'};
115 defined($header{'from'}) || &quit("no From header");
116 $replyto= defined($header{'reply-to'}) ? $header{'reply-to'} : $header{'from'};
119 $_= "$2 <$1>" if m/^([^\<\> \t\n\(\)]+) \(([^\(\)\<\>]+)\)$/;
121 print DEBUG "replytocompare >$replytocompare<\n";
123 if (!defined($header{'subject'}))
124 { $brokenness.= <<END;
126 Your message did not contain a Subject field. This is broken, I am
127 afraid - the Subject: line is a Required Header according to RFC822.
128 Please remember to include a Subject field in your messages in future.
129 If you did so the fact that it got lost probably indicates a poorly
130 configured mail system at your site or an intervening one.
132 $subject= '(no subject)';
133 } else { $subject= $header{'subject'}; }
136 $subject =~ s/^Re:\s*//i; $_= $subject."\n";
137 if ($tryref < 0 && m/^Bug ?\#(\d+)\D/i) { $tryref= $1+0; }
140 { $bfound= &lockreadbugmerge($tryref);
141 if ($bfound) { $ref= $tryref; }
143 { &htmllog("Reply","sent", $replyto,"Unknown problem report number <code>$tryref</code>.");
144 &sendmessage(<<END, '');
145 From: $gMaintainerEmail ($gProject $gBug Tracking System)
147 Subject: Unknown problem report $gBug#$tryref ($subject)
148 Message-ID: <handler.x.$nn.unknown\@$gEmailDomain>
149 In-Reply-To: $header{'message-id'}
150 References: $header{'message-id'} $s_msgid
151 X-$gProject-PR-Message: error
153 You sent a message to the $gBug tracking system which gave (in the
154 Subject line or encoded into the recipient at $gEmailDomain),
155 the number of a nonexistent $gBug report (#$tryref).
157 This may be because that $gBug report has been resolved for more than $gRemoveAge
158 days, and the record of it has been expunged, or because you mistyped
159 the $gBug report number.
161 Your message was dated $header{'date'} and was sent to
162 $baddress\@$gEmailDomain. It had
163 Message-ID $header{'message-id'}
164 and Subject $subject.
166 It has been filed (under junk) but otherwise ignored.
168 Please consult your records to find the correct $gBug report number, or
169 contact me, the system administrator, for assistance.
172 (administrator, $gProject $gBugs database)
174 (NB: If you are a system administrator and have no idea what I am
175 talking about this indicates a serious mail system misconfiguration
176 somewhere. Please contact me immediately.)
182 } else { &filelock('lock/-1'); }
184 if ($codeletter eq 'D' || $codeletter eq 'F')
185 { if ($replyto =~ m/$gBounceFroms/o ||
186 $header{'from'} =~ m/$gBounceFroms/o)
187 { &quit("bounce detected ! Mwaap! Mwaap!"); }
188 $markedby= $header{'from'} eq $replyto ? $replyto :
189 "$header{'from'} (reply to $replyto)";
190 if ($codeletter eq 'F')
191 { (&appendlog,&finish) if length($s_forwarded);
192 $receivedat= "forwarded\@$gEmailDomain";
193 $markaswhat= 'forwarded';
194 $set_forwarded= $header{'to'};
195 if ( length( $gListDomain ) > 0 && length( $gFowardList ) > 0 )
196 { $generalcc= "$gFowardList\@$gListDomain"; }
197 else { $generalcc=''; }
199 { (&appendlog,&finish) if length($s_done);
200 $receivedat= "done\@$gEmailDomain";
202 $set_done= $header{'from'};
203 if ( length( $gListDomain ) > 0 && length( $gDoneList ) > 0 )
204 { $generalcc= "$gDoneList\@$gListDomain"; }
205 else { $generalcc=''; }
208 { &htmllog("Warning","sent",$replyto,"Message ignored.");
209 &sendmessage(<<END, '');
210 From: $gMaintainerEmail ($gProject $gBug Tracking System)
212 Subject: Message with no $gBug number ignored by $receivedat
214 Message-ID: <header.x.$nn.warnignore\@$gEmailDomain>
215 In-Reply-To: $header{'message-id'}
216 References: $header{'message-id'} $s_msgid
217 X-$gProject-PR-Message: error
219 You sent a message to the $gProject $gBug tracking system old-style
220 unified mark as $markaswhat address ($receivedat),
221 without a recognisable $gBug number in the Subject.
222 Your message has been filed under junk but otherwise ignored.
224 If you don't know what I'm talking about then probably either:
226 (a) you unwittingly sent a message to done\@$gEmailDomain
227 because you replied to all recipients of the message a developer used
228 to mark a $gBug as done and you modified the Subject. In this case,
229 please do not be alarmed. To avoid confusion do not do it again, but
230 there is no need to apologise or mail anyone asking for an explanation.
232 (b) you are a system administrator, reading this because the $gBug
233 tracking system is responding to a misdirected bounce message. In this
234 case there is a serious mail system misconfiguration somewhere - please
235 contact me immediately.
237 Your message was dated $header{'date'} and had
238 message-id $header{'message-id'}
239 and subject $subject.
241 If you need any assistance or explanation please contact me.
244 (administrator, $gProject $gBugs database)
251 $noticeccval.= join(', ', grep($_ ne $replyto,@maintaddrs));
252 $noticeccval =~ s/\s+\n\s+/ /g; $noticeccval =~ s/^\s+/ /; $noticeccval =~ s/\s+$//;
253 if (length($noticeccval)) { $noticecc= "Cc: $noticeccval\n"; }
254 if (length($generalcc)) { $noticecc.= "Bcc: $generalcc\n"; }
255 @process= ($ref,split(/ /,$s_mergedwith));
258 { if ($ref != $orgref)
260 &lockreadbug($ref) || die "huh ? $ref from $orgref out of @process";
262 $s_done= $set_done if defined($set_done);
263 $s_forwarded= $set_forwarded if defined($set_forwarded);
264 &overwrite("db/$ref.status",
265 "$s_originator\n$s_date\n$s_subject\n$s_msgid\n".
266 "$s_package\n$s_keywords\n$s_done\n$s_forwarded\n$s_mergedwith\n$s_severity\n");
267 open(O,"db/$ref.report") || &quit("read original report: $!");
268 $x= join('',<O>); close(O);
269 if ($codeletter eq 'F')
270 { &htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
271 &sendmessage(<<END, '');
272 From: $gMaintainerEmail ($gProject $gBug Tracking System)
274 ${noticecc}Subject: $gBug#$ref: marked as forwarded ($s_subject)
275 Message-ID: <header.$ref.$nn.ackfwdd\@$gEmailDomain>
276 In-Reply-To: $header{'message-id'}
277 References: $header{'message-id'} $s_msgid
278 X-$gProject-PR-Message: forwarded $ref
280 Your message dated $header{'date'}
281 with message-id $header{'message-id'}
282 has caused the $gProject $gBug report #$ref,
284 to be marked as having been forwarded to the upstream software
285 author(s) $s_forwarded.
287 (NB: If you are a system administrator and have no idea what I am
288 talking about this indicates a serious mail system misconfiguration
289 somewhere. Please contact me immediately.)
292 (administrator, $gProject $gBugs database)
296 { &htmllog("Reply","sent",$replyto,"You have taken responsibility.");
297 &sendmessage(<<END."--------------------------------------\n".$x."---------------------------------------\n".join( "\n", @msg ), '');
298 From: $gMaintainerEmail ($gProject $gBug Tracking System)
300 ${noticecc}Subject: $gBug#$ref: marked as done ($s_subject)
301 Message-ID: <handler.$ref.$nn.ackdone\@$gEmailDomain>
302 In-Reply-To: $header{'message-id'}
303 References: $header{'message-id'} $s_msgid
304 X-$gProject-PR-Message: closed $ref
306 Your message dated $header{'date'}
307 with message-id $header{'message-id'}
308 and subject line $subject
309 has caused the attached $gBug report to be marked as done.
311 This means that you claim that the problem has been dealt with.
312 If this is not the case it is now your responsibility to reopen the
313 $gBug report if necessary, and/or fix the problem forthwith.
315 (NB: If you are a system administrator and have no idea what I am
316 talking about this indicates a serious mail system misconfiguration
317 somewhere. Please contact me immediately.)
320 (administrator, $gProject $gBugs database)
323 &htmllog("Notification","sent",$s_originator,
324 "$gBug acknowledged by developer.");
325 &sendmessage(<<END.join("\n",@msg),'');
326 From: $gMaintainerEmail ($gProject $gBug Tracking System)
328 Subject: $gBug#$ref acknowledged by developer
330 Message-ID: <handler.$ref.$nn.notifdone\@$gEmailDomain>
331 In-Reply-To: $s_msgid
332 References: $header{'message-id'} $s_msgid
333 X-$gProject-PR-Message: they-closed $ref
335 This is an automatic notification regarding your $gBug report
337 which was filed against the $s_package package.
339 It has been closed by one of the developers, namely
342 Their explanation is attached below. If this explanation is
343 unsatisfactory and you have not received a better one in a separate
344 message then please contact the developer directly, or email
345 $ref\@$gEmailDomain or me.
348 (administrator, $gProject $gBugs database)
358 { if ($codeletter eq 'U')
359 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
360 &sendmessage(<<END, '');
361 From: $gMaintainerEmail ($gProject $gBug Tracking System)
363 Subject: Message with no $gBug number cannot be sent to submitter !
365 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
366 In-Reply-To: $header{'message-id'}
367 References: $header{'message-id'} $s_msgid
368 X-$gProject-PR-Message: error
370 You sent a message to the $gProject $gBug tracking system send to $gBug
371 report submitter address $baddress\@$gEmailDomain, without a
372 recognisable $gBug number in the Subject. Your message has been filed
373 under junk but otherwise ignored.
375 If you don't know what I'm talking about then probably either:
377 (a) you unwittingly sent a message to $baddress\@$gEmailDomain
378 because you replied to all recipients of the message a developer sent
379 to a $gBug's submitter and you modified the Subject. In this case,
380 please do not be alarmed. To avoid confusion do not do it again, but
381 there is no need to apologise or mail anyone asking for an
384 (b) you are a system administrator, reading this because the $gBug
385 tracking system is responding to a misdirected bounce message. In this
386 case there is a serious mail system misconfiguration somewhere - please
387 contact me immediately.
389 Your message was dated $header{'date'} and had
390 message-id $header{'message-id'}
391 and subject $subject.
393 If you need any assistance or explanation please contact me.
396 (administrator, $gProject $gBugs database)
402 if (!defined($pheader{'package'}))
403 { &htmllog("Warning","sent",$replyto,"Message not forwarded.");
404 &sendmessage(<<END."---------------------------------------------------------------------------\n".join("\n", @msg), '');
405 From: $gMaintainerEmail ($gProject $gBug Tracking System)
407 Subject: Message with no Package: tag cannot be processed!
409 Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
410 In-Reply-To: $header{'message-id'}
411 References: $header{'message-id'} $s_msgid
412 X-$gProject-PR-Message: error
414 Your message didn't have a Package: line at the start (in the
415 pseudo-header following the real mail header), or didn't have a
416 pseudo-header at all.
418 This makes it much harder for us to categorise and deal with your
419 problem report. Please _resubmit_ your report and tell us which package
420 the report is on. For help, check out http://$gWebDomain/Reporting.html.
422 Your message was dated $header{'date'} and had
423 message-id $header{'message-id'}
424 and subject $subject.
425 The complete text of it is attached to this message.
427 If you need any assistance or explanation please contact me.
430 (administrator, $gProject $gBugs database)
435 } else { $s_package= $pheader{'package'}; }
437 if (defined($pheader{'keywords'})) {
438 $s_keywords= $pheader{'keywords'};
439 } elsif (defined($pheader{'tags'})) {
440 $s_keywords= $pheader{'tags'};
442 if (length($s_keywords)) {
444 my %gkws = map { ($_, 1) } @gTags;
445 foreach my $kw (sort split(/[,\s]+/, lc($s_keywords))) {
446 push @kws, $kw if (defined $gkws{$kw});
448 $s_keywords = join(" ", @kws);
451 if (defined($pheader{'severity'}) || defined($pheader{'priority'}))
452 { $s_severity= $pheader{'severity'};
453 $s_severity= $pheader{'priority'} unless ($s_severity);
455 if (!grep($_ eq $s_severity, @severities, "$gDefaultSeverity")) {
458 Your message specified a Severity: in the pseudo-header, but
459 the severity value $s_severity was not recognised.
460 The default severity $gDefaultSeverity is being used instead.
461 The recognised values are: $gShowSeverities.
463 # if we use @gSeverityList array in the above line, perl -c gives:
464 # In string, @gSeverityList now must be written as \@gSeverityList at
465 # process line 452, near "$gDefaultSeverity is being used instead.
469 &filelock("nextnumber.lock");
470 open(N,"nextnumber") || &quit("nextnumber: read: $!");
471 $v=<N>; $v =~ s/\n$// || &quit("nextnumber bad format");
472 $ref= $v+0; $v += 1; $newref=1;
473 &overwrite('nextnumber', "$v\n");
475 &overwrite("db/$ref.log",'');
476 &overwrite("db/$ref.status",
477 "$replyto\n$intdate\n$subject\n$header{'message-id'}\n".
478 "$s_package\n$s_keywords\n\n\n\n$s_severity\n");
479 &overwrite("db/$ref.report",
480 join("\n",@msg)."\n");
485 print DEBUG "maintainers >@maintaddrs<\n";
487 $orgsender= defined($header{'sender'}) ? "Orignal-Sender: $header{'sender'}\n" : '';
488 $newsubject= $subject; $newsubject =~ s/^$gBug#$ref\W*\s*//;
490 $xcchdr= $header{ 'x-debbugs-cc' };
491 if ($xcchdr =~ m/\S/) {
492 push(@resentccs,$xcchdr);
493 $resentccexplain.= <<END;
495 As you requested using X-Debbugs-CC, your message was also forwarded to
497 (after having been given a $gBug report number, if it did not have one).
501 if (@maintaddrs && ($codeletter eq 'B' || $codeletter eq 'M')) {
502 push(@resentccs,@maintaddrs);
503 $resentccexplain.= <<END." ".join("\n ",@maintaddrs)."\n";
505 Your message has been sent to the package maintainer(s):
509 $veryquiet= $codeletter eq 'Q';
510 if ($codeletter eq 'M' && !@maintaddrs) {
514 You requested that the message be sent to the package maintainer(s)
515 but either the $gBug report is not associated with any package (probably
516 because of a missing Package pseudo-header field in the original $gBug
517 report), or the package(s) specified do not have any maintainer(s).
519 Your message has *not* been sent to any package maintainers; it has
520 merely been filed in the $gBug tracking system. If you require assistance
521 please contact $gMaintainerEmail quoting the $gBug number $ref.
525 $resentccval.= join(', ',@resentccs);
526 $resentccval =~ s/\s+\n\s+/ /g; $resentccval =~ s/^\s+/ /; $resentccval =~ s/\s+$//;
527 if (length($resentccval)) { $resentcc= "Resent-CC: $resentccval\n"; }
529 if ($codeletter eq 'U') {
530 &htmllog("Message", "sent on", $s_originator, "$gBug#$ref.");
531 &sendmessage(<<END,$s_originator,@resentccs);
532 Subject: $gBug#$ref: $newsubject
533 Reply-To: $replyto, $ref-quiet\@$gEmailDomain
534 ${orgsender}Resent-To: $s_originator
535 ${resentcc}Resent-Date: $tdate
536 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
537 Resent-Sender: $gMaintainerEmail
538 X-$gProject-PR-Message: report $ref
539 X-$gProject-PR-Package: $s_package
540 X-$gProject-PR-Keywords: $s_keywords
543 } elsif ($codeletter eq 'B') {
544 &htmllog($newref ? "Report" : "Information", "forwarded",
545 join(', ',"$gSubmitList\@$gListDomain",@resentccs),
546 "<code>$gBug#$ref</code>".
547 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
549 &sendmessage(<<END,"$gSubmitList\@$gListDomain",@resentccs);
550 Subject: $gBug#$ref: $newsubject
551 Reply-To: $replyto, $ref\@$gEmailDomain
552 Resent-From: $header{'from'}
553 ${orgsender}Resent-To: $gSubmitList\@$gListDomain
554 ${resentcc}Resent-Date: $tdate
555 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
556 Resent-Sender: $gMaintainerEmail
557 X-$gProject-PR-Message: report $ref
558 X-$gProject-PR-Package: $s_package
559 X-$gProject-PR-Keywords: $s_keywords
562 } elsif (@resentccs) {
563 # D and F done far earlier; B just done - so this must be M or Q
564 # We preserve whichever it was in the Reply-To (possibly adding
566 &htmllog($newref ? "Report" : "Information", "forwarded",
568 "<code>$gBug#$ref</code>".
569 (length($s_package)? "; Package <code>".&sani($s_package)."</code>" : '').
571 &sendmessage(<<END,@resentccs);
572 Subject: $gBug#$ref: $newsubject
573 Reply-To: $replyto, $ref-$baddressroot\@$gEmailDomain
574 Resent-From: $header{'from'}
575 ${orgsender}Resent-To: $resentccval
577 Resent-Message-ID: <handler.$ref.$nn\@$gEmailDomain>
578 Resent-Sender: $gMaintainerEmail
579 X-$gProject-PR-Message: report $ref
580 X-$gProject-PR-Package: $s_package
581 X-$gProject-PR-Keywords: $s_keywords
586 $htmlbreak= length($brokenness) ? "<p>\n".&sani($brokenness)."\n<p>\n" : '';
587 $htmlbreak =~ s/\n\n/\n<P>\n\n/g;
588 if (length($resentccval)) {
590 " Copy sent to <code>".&sani($resentccval)."</code>.".
594 &htmllog("Acknowledgement","sent",$replyto,
596 "New $gBug report received and filed, but not forwarded." :
597 "New $gBug report received and forwarded."). $htmlbreak);
598 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
599 From: $gMaintainerEmail ($gProject $gBug Tracking System)
601 Subject: $gBug#$ref: Acknowledgement of QUIET report
603 Message-ID: <handler.$ref.$nn.ackquiet\@$gEmailDomain>
604 In-Reply-To: $header{'message-id'}
605 References: $header{'message-id'}
606 X-$gProject-PR-Message: ack-quiet $ref
608 Thank you for the problem report you have sent regarding $gProject.
609 This is an automatically generated reply, to let you know your message
610 has been received. It has not been forwarded to the developers or
611 their mailing list; you should ensure that the developers are aware of
612 the problem you have entered into the system - preferably quoting the
613 $gBug reference number, #$ref.
615 If you wish to submit further information on your problem, please send it
616 to $ref-$baddressroot\@$gEmailDomain (and *not*
617 to $baddress\@$gEmailDomain).
619 Please do not reply to the address at the top of this message,
620 unless you wish to report a problem with the $gBug-tracking system.
623 (administrator, $gProject $gBugs database)
625 From: $gMaintainerEmail ($gProject $gBug Tracking System)
627 Subject: $gBug#$ref: Acknowledgement of maintainer-only report
629 Message-ID: <handler.$ref.$nn.ackmaint\@$gEmailDomain>
630 In-Reply-To: $header{'message-id'}
631 References: $header{'message-id'}
632 X-$gProject-PR-Message: ack-maintonly $ref
634 Thank you for the problem report you have sent regarding $gProject.
635 This is an automatically generated reply, to let you know your message has
636 been received. It is being forwarded to the developers (but not the mailing
637 list, as you requested) for their attention; they will reply in due course.
639 If you wish to submit further information on your problem, please send
640 it to $ref-$baddressroot\@$gEmailDomain (and *not*
641 to $baddress\@$gEmailDomain).
643 Please do not reply to the address at the top of this message,
644 unless you wish to report a problem with the $gBug-tracking system.
647 (administrator, $gProject $gBugs database)
649 From: $gMaintainerEmail ($gProject $gBug Tracking System)
651 Subject: $gBug#$ref: Acknowledgement ($subject)
652 Message-ID: <handler.$ref.$nn.ack\@$gEmailDomain>
653 In-Reply-To: $header{'message-id'}
654 References: $header{'message-id'}
655 X-$gProject-PR-Message: ack $ref
657 Thank you for the problem report you have sent regarding $gProject.
658 This is an automatically generated reply, to let you know your message has
659 been received. It is being forwarded to the developers mailing list for
660 their attention; they will reply in due course.
662 If you wish to submit further information on your problem, please send
663 it to $ref\@$gEmailDomain (and *not* to
664 $baddress\@$gEmailDomain).
666 Please do not reply to the address at the top of this message,
667 unless you wish to report a problem with the $gBug-tracking system.
670 (administrator, $gProject $gBugs database)
672 } elsif ($codeletter ne 'U') {
673 &htmllog("Acknowledgement","sent",$replyto,
674 ($veryquiet ? "Extra info received and filed, but not forwarded." :
675 $codeletter eq 'M' ? "Extra info received and forwarded to maintainer." :
676 "Extra info received and forwarded to list."). $htmlbreak);
677 &sendmessage($veryquiet ? <<END : $codeletter eq 'M' ? <<END : <<END,'');
678 From: $gMaintainerEmail ($gProject $gBug Tracking System)
680 Subject: $gBug#$ref: Info received and FILED only
682 Message-ID: <handler.$ref.$nn.ackinfoquiet\@$gEmailDomain>
683 In-Reply-To: $header{'message-id'}
684 References: $header{'message-id'}
685 X-$gProject-PR-Message: ack-info-quiet $ref
687 Thank you for the additional information you have supplied regarding
688 this problem report. It has NOT been forwarded to the developers, but
689 will accompany the original report in the $gBug tracking system. Please
690 ensure that you yourself have sent a copy of the additional
691 information to any relevant developers or mailing lists.
693 If you wish to continue to submit further information on your problem,
694 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
696 Please do not reply to the address at the top of this message,
697 unless you wish to report a problem with the $gBug-tracking system.
700 (administrator, $gProject $gBugs database)
702 From: $gMaintainerEmail ($gProject $gBug Tracking System)
704 Subject: $gBug#$ref: Info received for maintainer only
706 Message-ID: <handler.$ref.$nn.ackinfomaint\@$gEmailDomain>
707 In-Reply-To: $header{'message-id'}
708 References: $header{'message-id'}
709 X-$gProject-PR-Message: ack-info $ref
711 Thank you for the additional information you have supplied regarding
712 this problem report. It has been forwarded to the developer(s) (but
713 not to the mailing list) to accompany the original report.
715 If you wish to continue to submit further information on your problem,
716 please send it to $ref-$baddressroot\@$gEmailDomain, as before.
718 Please do not reply to the address at the top of this message,
719 unless you wish to report a problem with the $gBug-tracking system.
722 (administrator, $gProject $gBugs database)
724 From: $gMaintainerEmail ($gProject $gBug Tracking System)
726 Subject: $gBug#$ref: Info received (was $subject)
727 Message-ID: <handler.$ref.$nn.ackinfo\@$gEmailDomain>
728 In-Reply-To: $header{'message-id'}
729 References: $header{'message-id'}
730 X-$gProject-PR-Message: ack-info-maintonly $ref
732 Thank you for the additional information you have supplied regarding
733 this problem report. It has been forwarded to the developer(s) and
734 to the developers mailing list to accompany the original report.
736 If you wish to continue to submit further information on your problem,
737 please send it to $ref\@$gEmailDomain, as before.
739 Please do not reply to the address at the top of this message,
740 unless you wish to report a problem with the $gBug-tracking system.
743 (administrator, $gProject $gBugs database)
752 open(NEW,">$f.new") || &quit("$f.new: create: $!");
753 print(NEW "$v") || &quit("$f.new: write: $!");
754 close(NEW) || &quit("$f.new: close: $!");
755 rename("$f.new","$f") || &quit("rename $f.new to $f: $!");
759 if (!open(AP,">>db/$ref.log")) {
760 print DEBUG "failed open log<\n";
761 print DEBUG "failed open log err $!<\n";
762 &quit("opening db/$ref.log (li): $!");
764 print(AP "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log (li): $!");
765 close(AP) || &quit("closing db/$ref.log (li): $!");
769 utime(time,time,"db");
771 while ($u= $cleanups[$#cleanups]) { &$u; }
772 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
776 &quit("wot no exit");
778 sub chldhandle { $chldexit = 'yes'; }
781 local ($whatobj,$whatverb,$where,$desc) = @_;
782 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lh): $!");
785 "<strong>$whatobj $whatverb</strong> to <code>".&sani($where).
786 "</code>:<br>\n". $desc.
787 "\n\3\n") || &quit("writing db/$ref.log (lh): $!");
788 close(AP) || &quit("closing db/$ref.log (lh): $!");
793 map { $_->address() }
794 map { Mail::Address->parse($_) } @_;
799 local ($msg,@recips) = @_;
800 if ($recips[0] eq '' && $#recips == 0) { @recips= ('-t'); }
802 #save email to the log
803 open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lo): $!");
804 print(AP "\2\n",join("\4",@recips),"\n\5\n$msg\n\3\n") ||
805 &quit("writing db/$ref.log (lo): $!");
806 close(AP) || &quit("closing db/$ref.log (lo): $!");
808 #if debbuging.. save email to a log
809 # open AP, ">>debug";
810 # print AP join( '|', @recips )."\n>>";
811 # print AP get_addresses( @recips );
812 # print AP "<<\n".$msg;
813 # print AP "\n--------------------------------------------------------\n";
818 $SIG{'CHLD'}='chldhandle';
819 #print DEBUG "mailing sigchild set up<\n";
822 #print DEBUG "mailing opened pipe fork<\n";
823 defined($c) || die $!;
824 #print DEBUG "mailing opened pipe fork ok $c<\n";
825 if (!$c) { # ie, we are in the child process
826 #print DEBUG "mailing child<\n";
827 unless (open(STDERR,">&STDOUT")) {
828 #print DEBUG "mailing child opened stderr<\n";
829 print STDOUT "redirect stderr: $!\n";
830 #print DEBUG "mailing child opened stderr fail<\n";
832 #print DEBUG "mailing child opened stderr fail exit !?<\n";
834 #print DEBUG "mailing child opened stderr ok<\n";
836 #print DEBUG "mailing child forked again<\n";
837 defined($c) || die $!;
838 #print DEBUG "mailing child forked again ok $c<\n";
839 if (!$c) { # ie, we are the child process
840 #print DEBUG "mailing grandchild<\n";
841 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
842 #print DEBUG "mailing grandchild exec failed<\n";
844 #print DEBUG "mailing grandchild died !?<\n";
846 #print DEBUG "mailing child not grandchild<\n";
847 print(D $msg) || die $!;
848 #print DEBUG "mailing child printed msg<\n";
850 #print DEBUG "mailing child closed pipe<\n";
851 die "\n*** command returned exit status $?\n" if $?;
852 #print DEBUG "mailing child exit status ok<\n";
854 #print DEBUG "mailing child exited ?!<\n";
856 #print DEBUG "mailing parent<\n";
858 #print DEBUG "mailing parent results emptied<\n";
859 while( $chldexit eq 'no' ) { $results.= $_; }
860 #print DEBUG "mailing parent results read >$results<\n";
862 #print DEBUG "mailing parent results closed<\n";
863 $results.= "\n*** child returned exit status $?\n" if $?;
864 #print DEBUG "mailing parent exit status ok<\n";
865 $SIG{'CHLD'}='DEFAULT';
866 #print DEBUG "mailing parent sigchild default<\n";
867 if (length($results)) { &quit("running sendmail: $results"); }
868 #print DEBUG "mailing parent results ok<\n";
871 sub checkmaintainers {
872 return if $maintainerschecked++;
873 return if !length($s_package);
874 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
878 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
879 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
880 $maintainerof{$1}= $2;
883 $anymaintfound=0; $anymaintnotfound=0;
884 for $p (split(m/[ \t?,()]+/,$s_package)) {
886 if (defined($maintainerof{$p})) {
887 print DEBUG "maintainer add >$p|$maintainerof{$p}<\n";
888 $addmaint= $maintainerof{$p};
889 push(@maintaddrs,$addmaint) unless
890 $addmaint eq $replyto || grep($_ eq $addmaint, @maintaddrs);
893 print DEBUG "maintainer none >$p<\n";