]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Add the rest of the missing templates
authorDon Armstrong <don@donarmstrong.com>
Sat, 22 Sep 2007 08:09:13 +0000 (01:09 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sat, 22 Sep 2007 08:09:13 +0000 (01:09 -0700)
 * process.in is now fully templatetized

scripts/process.in
templates/en_US/mail/footer.tmpl
templates/en_US/mail/process_broken_subject.tmpl [new file with mode: 0644]
templates/en_US/mail/process_mark_as_done.tmpl [new file with mode: 0644]
templates/en_US/mail/process_mark_as_forwarded.tmpl [new file with mode: 0644]
templates/en_US/mail/process_no_bug_number.tmpl [new file with mode: 0644]
templates/en_US/mail/process_no_package.tmpl [new file with mode: 0644]
templates/en_US/mail/process_unknown_bug_number.tmpl [new file with mode: 0644]
templates/en_US/mail/process_your_bug_done.tmpl [new file with mode: 0644]
templates/en_US/mail/serious_mail_misconfiguration.tmpl [new file with mode: 0644]

index 633df4090527475fb77735d4b2caec7569dc3897..7f7882e91246df85e0991652e25901c8aa8d647d 100755 (executable)
@@ -200,12 +200,7 @@ unless (length $replyto) {
 my $subject = '(no subject)';
 if (!defined($header{'subject'})) 
 {
-       $brokenness.= <<END;
-
-Your message did not contain a Subject field. They are recommended and
-useful because the title of a $gBug is determined using this field.
-Please remember to include a Subject field in your messages in future.
-END
+       $brokenness.= fill_template('mail/process_broken_subject');
 
 } else { 
     $subject= $header{'subject'}; 
@@ -225,47 +220,23 @@ if ($tryref >= 0)
         $ref= $tryref; 
     } else {
         &htmllog("Reply","sent", $replyto,"Unknown problem report number <code>$tryref</code>.");
-        my $archivenote = '';
-        if ($gRemoveAge) {
-            $archivenote = <<END;
-This may be because that $gBug report has been resolved for more than $gRemoveAge
-days, and the record of it has been archived and made read-only, or
-because you mistyped the $gBug report number.
-
-END
-        }
-        &sendmessage(<<END, '');
-From: $gMaintainerEmail ($gProject $gBug Tracking System)
-To: $replyto
-Subject: Unknown problem report $gBug#$tryref ($subject)
-Message-ID: <handler.x.$nn.unknown\@$gEmailDomain>
-In-Reply-To: $header{'message-id'}
-References: $header{'message-id'} $data->{msgid}
-Precedence: bulk
-X-$gProject-PR-Message: error
-
-You sent a message to the $gBug tracking system which gave (in the
-Subject line or encoded into the recipient at $gEmailDomain),
-the number of a nonexistent $gBug report (#$tryref).
-
-${archivenote}Your message was dated $header{'date'} and was sent to
-$baddress\@$gEmailDomain.  It had
-Message-ID $header{'message-id'}
-and Subject $subject.
-
-It has been filed (under junk) but otherwise ignored.
-
-Please consult your records to find the correct $gBug report number, or
-contact me, the system administrator, for assistance.
-
-$gMaintainer
-(administrator, $gProject $gBugs database)
-
-(NB: If you are a system administrator and have no idea what I am
-talking about this indicates a serious mail system misconfiguration
-somewhere.  Please contact me immediately.)
-
-END
+        &sendmessage(create_mime_message(
+          [From          => "$gMaintainerEmail ($gProject $gBug Tracking System)",
+          To            => $replyto,
+          Subject       => "Unknown problem report $gBug#$tryref ($subject)",
+          'Message-ID'  => "<handler.x.$nn.unknown\@$gEmailDomain>",
+          'In-Reply-To' => $header{'message-id'},
+          References    => "$header{'message-id'} $data->{msgid}",
+          Precedence    => 'bulk',
+          "X-$gProject-PR-Message" => 'error',
+         ],message_body_template('process_unknown_bug_number',
+                                 {subject => $subject,
+                                  date    => $date,
+                                  baddress => $baddress,
+                                  tryref   => $tryref,
+                                  messageid => $header{'message-id'},
+                                 },
+                                )),'');
         &appendlog;
         &finish;
     }
@@ -340,45 +311,23 @@ if ($codeletter eq 'D' || $codeletter eq 'F')
     }
     if ($ref<0) {
        &htmllog("Warning","sent",$replyto,"Message ignored.");
-        &sendmessage(<<END, '');
-From: $gMaintainerEmail ($gProject $gBug Tracking System)
-To: $replyto
-Subject: Message with no $gBug number ignored by $receivedat
-         ($subject)
-Message-ID: <header.x.$nn.warnignore\@$gEmailDomain>
-In-Reply-To: $header{'message-id'}
-References: $header{'message-id'} $data->{msgid}
-Precedence: bulk
-X-$gProject-PR-Message: error
-
-You sent a message to the $gProject $gBug tracking system old-style
-unified mark as $markaswhat address ($receivedat),
-without a recognisable $gBug number in the Subject.
-Your message has been filed under junk but otherwise ignored.
-
-If you don't know what I'm talking about then probably either:
-
-(a) you unwittingly sent a message to done\@$gEmailDomain
-because you replied to all recipients of the message a developer used
-to mark a $gBug as done and you modified the Subject.  In this case,
-please do not be alarmed.  To avoid confusion do not do it again, but
-there is no need to apologise or mail anyone asking for an explanation.
-
-(b) you are a system administrator, reading this because the $gBug 
-tracking system is responding to a misdirected bounce message.  In this
-case there is a serious mail system misconfiguration somewhere - please
-contact me immediately.
-
-Your message was dated $header{'date'} and had
-message-id $header{'message-id'}
-and subject $subject.
-
-If you need any assistance or explanation please contact me.
-
-$gMaintainer
-(administrator, $gProject $gBugs database)
-
-END
+       &sendmessage(create_mime_message(
+          [From          => "$gMaintainerEmail ($gProject $gBug Tracking System)",
+          To            => $replyto,
+          Subject       => "Message with no $gBug number ignored by $receivedat ($subject)",
+          'Message-ID'  => "<handler.x.$nn.warnignore\@$gEmailDomain>",
+          'In-Reply-To' => $header{'message-id'},
+          References    => "$header{'message-id'} $data->{msgid}",
+          Precedence    => 'bulk',
+          "X-$gProject-PR-Message" => 'error',
+         ],message_body_template('process_no_bug_number',
+                                 {subject => $subject,
+                                  date    => $date,
+                                  markaswhat => $markaswhat,
+                                  receivedat => $receivedat,
+                                  messageid => $header{'message-id'},
+                                 },
+                                )),'');
        &appendlog;
        &finish;
     }
@@ -440,23 +389,13 @@ END
               "X-$gProject-PR-Keywords" => $data->{keywords},
              # Only have a X-$gProject-PR-Source when we know the source package
              length($source_package)?("X-$gProject-PR-Source" => $source_package):(),
-             ],<<END ,[join("\n",@msg)]),'',[$replyto,@generalbcc,@noticecc],1);
-Your message dated $header{'date'}
-with message-id $header{'message-id'}
-has caused the $gProject $gBug report #$ref,
-regarding $data->{subject}
-to be marked as having been forwarded to the upstream software
-author(s) $data->{forwarded}.
-
-(NB: If you are a system administrator and have no idea what I am
-talking about this indicates a serious mail system misconfiguration
-somewhere.  Please contact me immediately.)
-
-$gMaintainer
-(administrator, $gProject $gBugs database)
-
-END
-
+             ],message_body_template('mail/process_mark_as_forwarded',
+                                    {date => $header{date},
+                                     messageid => $header{'message-id'},
+                                     data      => $data,
+                                    },
+                                   ),
+            [join("\n",@msg)]),'',[$replyto,@generalbcc,@noticecc],1);
         } else {
            &htmllog("Reply","sent",$replyto,"You have taken responsibility.");
             &sendmessage(create_mime_message(
@@ -473,25 +412,15 @@ END
               "X-$gProject-PR-Keywords" => $data->{keywords},
              # Only have a X-$gProject-PR-Source when we know the source package
              length($source_package)?("X-$gProject-PR-Source" => $source_package):(),
-             ],<<END ,[$orig_report,join("\n",@msg)]),'',[$replyto,@generalbcc,@noticecc],1);
-Your message dated $header{'date'}
-with message-id $header{'message-id'}
-and subject line $subject
-has caused the attached $gBug report to be marked as done.
-
-This means that you claim that the problem has been dealt with.
-If this is not the case it is now your responsibility to reopen the
-$gBug report if necessary, and/or fix the problem forthwith.
-
-(NB: If you are a system administrator and have no idea what I am
-talking about this indicates a serious mail system misconfiguration
-somewhere.  Please contact me immediately.)
-
-$gMaintainer
-(administrator, $gProject $gBugs database)
-
-END
-            &htmllog("Notification","sent",$data->{originator}, 
+             ],message_body_template('mail/process_mark_as_done',
+                                    {date => $header{date},
+                                     messageid => $header{'message-id'},
+                                     subject   => $header{subject},
+                                     data      => $data,
+                                    },
+                                   ),
+            [$orig_report,join("\n",@msg)]),'',[$replyto,@generalbcc,@noticecc],1);
+            &htmllog("Notification","sent",$data->{originator},
                "$gBug acknowledged by developer.");
             &sendmessage(create_mime_message(
             ["X-Loop"      => "$gMaintainerEmail",
@@ -508,23 +437,12 @@ END
              length($source_package)?("X-$gProject-PR-Source" => $source_package):(),
               "Reply-To"                => "$ref\@$gEmailDomain",
               "Content-Type"            => 'text/plain; charset="utf-8"',
-             ],<<END ,[join("\n",@msg)]),'',undef,1);
-This is an automatic notification regarding your $gBug report
-which was filed against the $data->{package} package:
-
-#$ref: $data->{subject}
-
-It has been closed by $markedby.
-
-Their explanation is attached below.  If this explanation is
-unsatisfactory and you have not received a better one in a separate
-message then please contact $markedby by replying
-to this email.
-
-$gMaintainer
-(administrator, $gProject $gBugs database)
-
-END
+             ],message_body_template('mail/process_mark_as_done',
+                                    {data      => $data,
+                                     markedby  => $markedby,
+                                    },
+                                   ),
+            [join("\n",@msg),$orig_report]),'',undef,1);
         }
        &appendlog;
     }
@@ -534,46 +452,23 @@ END
 if ($ref<0) {
     if ($codeletter eq 'U') {
         &htmllog("Warning","sent",$replyto,"Message not forwarded.");
-        &sendmessage(<<END, '');
-From: $gMaintainerEmail ($gProject $gBug Tracking System)
-To: $replyto
-Subject: Message with no $gBug number cannot be sent to submitter !
-         ($subject)
-Message-ID: <handler.x.$nn.nonumnosub\@$gEmailDomain>
-In-Reply-To: $header{'message-id'}
-References: $header{'message-id'} $data->{msgid}
-Precedence: bulk
-X-$gProject-PR-Message: error
-
-You sent a message to the $gProject $gBug tracking system's $gBug 
-report submitter address $baddress\@$gEmailDomain, without a
-recognisable $gBug number in the Subject.  Your message has been filed
-under junk but otherwise ignored.
-
-If you don't know what I'm talking about then probably either:
-
-(a) you unwittingly sent a message to $baddress\@$gEmailDomain
-because you replied to all recipients of the message a developer sent
-to a $gBug\'s submitter and you modified the Subject.  In this case,
-please do not be alarmed.  To avoid confusion do not do it again, but
-there is no need to apologise or mail anyone asking for an
-explanation.
-
-(b) you are a system administrator, reading this because the $gBug 
-tracking system is responding to a misdirected bounce message.  In this
-case there is a serious mail system misconfiguration somewhere - please
-contact me immediately.
-
-Your message was dated $header{'date'} and had
-message-id $header{'message-id'}
-and subject $subject.
-
-If you need any assistance or explanation please contact me.
-
-$gMaintainer
-(administrator, $gProject $gBugs database)
-
-END
+       &sendmessage(create_mime_message(
+          [From          => "$gMaintainerEmail ($gProject $gBug Tracking System)",
+          To            => $replyto,
+          Subject       => "Message with no $gBug number cannot be sent to submitter! ($subject)",
+          'Message-ID'  => "<handler.x.$nn.nonumnosub\@$gEmailDomain>",
+          'In-Reply-To' => $header{'message-id'},
+          References    => "$header{'message-id'} $data->{msgid}",
+          Precedence    => 'bulk',
+          "X-$gProject-PR-Message" => 'error',
+         ],message_body_template('process_no_bug_number',
+                                 {subject => $subject,
+                                  date    => $date,
+                                  markaswhat => 'submitter',
+                                  receivedat => "$baddress\@$gEmailDomain",
+                                  messageid => $header{'message-id'},
+                                 },
+                                )),'');
        &appendlog;
        &finish;
     }
@@ -599,29 +494,14 @@ END
                         References    => "$header{'message-id'} $data->{msgid}",
                         Precedence    => 'bulk',
                         "X-$gProject-PR-Message" => 'error'
-                      ],<<END,[join("\n", @msg)]), '',undef,1);
-
-Your message didn't have a Package: line at the start (in the
-pseudo-header following the real mail header), or didn't have a
-pseudo-header at all.  Your message has been filed under junk but
-otherwise ignored.
-
-This makes it much harder for us to categorise and deal with your
-problem report. Please _resubmit_ your report to $baddress\@$gEmailDomain
-and tell us which package the report is on. For help, check out
-http://$gWebDomain/Reporting$gHTMLSuffix.
-
-Your message was dated $header{'date'} and had
-message-id $header{'message-id'}
-and subject $subject.
-The complete text of it is attached to this message.
-
-If you need any assistance or explanation please contact me.
-
-$gMaintainer
-(administrator, $gProject $gBugs database)
-
-END
+                      ],
+          message_body_template('mail/process_mark_as_done',
+                                {date => $header{date},
+                                 subject => $subject,
+                                 messageid => $header{'message-id'},
+                                 baddress => $baddress,
+                                },
+                               ),[join("\n", @msg)]), '',undef,1);
        &appendlog;
        &finish;
     }
@@ -1065,11 +945,11 @@ sub message_body_template{
      my ($template,$extra_var) = @_;
      $extra_var ||={};
      my $body = fill_template($template,$extra_var);
-     return fill_in_template(template  => 'mail/message_body',
-                            variables => {%{$extra_var},
-                                          body => $body,
-                                         },
-                           );
+     return fill_template('mail/message_body',
+                         {%{$extra_var},
+                          body => $body,
+                         },
+                        );
 }
 
 =head2 fill_template
@@ -1086,7 +966,8 @@ sub fill_template{
      $extra_var ||={};
      my $variables = {config => \%config,
                      defined($ref)?(ref    => $ref):(),
-                     bug_url => sub{bug_url($_[0])},
+                     defined($data)?(data  => $data):(),
+                     bugurl => sub{"bug_url for $_[0] ".bug_url($_[0])},
                      %{$extra_var},
                     };
      return fill_in_template(template => $template,
index 16de892350c952318aa9aa58cb5216bbf85c031c..211a058f9b807eee90f25b06bd2372fd68463352 100644 (file)
@@ -5,8 +5,7 @@ for my $bug ($ref,@refs) {
     next unless defined $bug;
     next if exists $ref_handled{$bug};
     $ref_handled{$bug} = 1;
-    $OUT .= bug_url($bug),qq(\n);
+    $OUT .= bugurl($bug).qq(\n);
 }
-}
-{$config{project}} {ucfirst($config{bug})} Tracking System
+}{$config{project}} {ucfirst($config{bug})} Tracking System
 Contact {$config{maintainer_email}} with problems
diff --git a/templates/en_US/mail/process_broken_subject.tmpl b/templates/en_US/mail/process_broken_subject.tmpl
new file mode 100644 (file)
index 0000000..1ca79a8
--- /dev/null
@@ -0,0 +1,4 @@
+
+Your message did not contain a Subject field. They are recommended and
+useful because the title of a $gBug is determined using this field.
+Please remember to include a Subject field in your messages in future.
diff --git a/templates/en_US/mail/process_mark_as_done.tmpl b/templates/en_US/mail/process_mark_as_done.tmpl
new file mode 100644 (file)
index 0000000..f764c43
--- /dev/null
@@ -0,0 +1,13 @@
+Your message dated {$date}
+with message-id {$messageid}
+and subject line {$subject}
+has caused the {$config{project}} {$config{bug}} report #{$ref},
+regarding {$data{subject}}
+to be marked as done.
+
+This means that you claim that the problem has been dealt with.
+If this is not the case it is now your responsibility to reopen the
+{$config{bug}} report if necessary, and/or fix the problem forthwith.
+
+{include('mail/serious_mail_misconfiguration')}
+
diff --git a/templates/en_US/mail/process_mark_as_forwarded.tmpl b/templates/en_US/mail/process_mark_as_forwarded.tmpl
new file mode 100644 (file)
index 0000000..a3ace02
--- /dev/null
@@ -0,0 +1,9 @@
+Your message dated {$date}
+with message-id {$messageid}
+has caused the $gProject $gBug report #$ref,
+regarding {$data{subject}}
+to be marked as having been forwarded to the upstream software
+author(s) {$data{forwarded}}
+
+{include('mail/serious_mail_misconfiguration')}
+
diff --git a/templates/en_US/mail/process_no_bug_number.tmpl b/templates/en_US/mail/process_no_bug_number.tmpl
new file mode 100644 (file)
index 0000000..033d180
--- /dev/null
@@ -0,0 +1,22 @@
+You sent a message to the {$config{project}} {$config{bug}} tracking system old-style
+{$markaswhat} address ({$receivedat}),
+without a recognisable $gBug number in the Subject.
+Your message has been filed under junk but otherwise ignored.
+
+If you don't know what I'm talking about then probably either:
+
+You unwittingly sent a message to {$receivedat}
+because you replied to all recipients of the message a developer used
+to mark a {$config{bug}} as {$markaswhat} and you modified the Subject.  In this case,
+please do not be alarmed.  To avoid confusion do not do it again, but
+there is no need to apologise or mail anyone asking for an explanation.
+
+-or-
+
+{include('mail/serious_mail_misconfiguration')}
+
+Your message was dated {$date} and had
+message-id {$messageid}
+and subject {$subject}.
+
+If you need any assistance or explanation please contact {$config{maintainer_email}}.
diff --git a/templates/en_US/mail/process_no_package.tmpl b/templates/en_US/mail/process_no_package.tmpl
new file mode 100644 (file)
index 0000000..605c96e
--- /dev/null
@@ -0,0 +1,16 @@
+Your message didn't have a Package: line at the start (in the
+pseudo-header following the real mail header), or didn't have a
+pseudo-header at all.  Your message has been filed under junk but
+otherwise ignored.
+
+This makes it much harder for us to categorise and deal with your
+problem report. Please _resubmit_ your report to {$baddress}\@{$config{email_domain}}
+and tell us which package the report is on. For help, check out
+http://{$config{web_domain}}/Reporting{$config{html_suffix}}.
+
+Your message was dated {$date} and had
+message-id {$messageid}
+and subject {$subject}.
+The complete text of it is attached to this message.
+
+If you need any assistance or explanation please contact {$config{maintainer_email}}.
diff --git a/templates/en_US/mail/process_unknown_bug_number.tmpl b/templates/en_US/mail/process_unknown_bug_number.tmpl
new file mode 100644 (file)
index 0000000..b3391a1
--- /dev/null
@@ -0,0 +1,21 @@
+You sent a message to the {$config{bug}} tracking system which gave (in the
+Subject line or encoded into the recipient at {$config{email_domain}),
+the number of a nonexistent {$config{bug}} report (#{$tryref}).
+{if ($config{remove_age}){
+  $OUT .= "\n".
+"This may be because that $config{bug} report has been resolved for more than $config{remove_age}\n".
+"days, and the record of it has been archived and made read-only, or\n".
+"because you mistyped the $config{bug} report number.\n"
+  }
+}
+Your message was dated {$date} and was sent to
+{$baddress}@{$config{email_domain}}.  It had
+Message-ID {$messageid}
+and Subject {$subject}
+
+It has been filed (under junk) but otherwise ignored.
+
+Please consult your records to find the correct {$config{bug}} report
+number, or contact {$config{maintainer_email}} for assistance.
+
+{include('mail/serious_mail_misconfiguration')}
\ No newline at end of file
diff --git a/templates/en_US/mail/process_your_bug_done.tmpl b/templates/en_US/mail/process_your_bug_done.tmpl
new file mode 100644 (file)
index 0000000..7f90a87
--- /dev/null
@@ -0,0 +1,12 @@
+This is an automatic notification regarding your {$config{bug}} report
+which was filed against the {$data{package}} package:
+
+#{$ref}: {$data{subject}}
+
+It has been closed by {$markedby}.
+
+Their explanation is attached below along with your original report.
+If this explanation is unsatisfactory and you have not received a
+better one in a separate message then please contact {$markedby} by
+replying to this email.
+
diff --git a/templates/en_US/mail/serious_mail_misconfiguration.tmpl b/templates/en_US/mail/serious_mail_misconfiguration.tmpl
new file mode 100644 (file)
index 0000000..1a9539f
--- /dev/null
@@ -0,0 +1,4 @@
+(NB: If you are a system administrator and have no idea what this
+message is talking about, this may indicate a serious mail system
+misconfiguration somewhere. Please contact {$config{maintainer_email}}
+immediately.)
\ No newline at end of file