From fbdd05dd8a942926beb67c15a804b0bd949ad45f Mon Sep 17 00:00:00 2001 From: "seth%cs.brandeis.edu" <> Date: Thu, 16 Mar 2000 07:39:03 +0000 Subject: Added a bugzilla.procmailrc as a sample procmailrc file bugzilla_email_append.pl calls processmail.pl after writing out the changes. --- contrib/README.Mailif | 5 ++++- contrib/bugzilla.procmailrc | 30 ++++++++++++++++++++++++++++++ contrib/bugzilla_email_append.pl | 4 +++- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 contrib/bugzilla.procmailrc diff --git a/contrib/README.Mailif b/contrib/README.Mailif index b2420bd28..8b6604438 100644 --- a/contrib/README.Mailif +++ b/contrib/README.Mailif @@ -34,6 +34,9 @@ additional line to procmail : fixes many problems. +See bugzilla.procmailrc for a sample procmailrc that works for me (SML) and +also deals with bugzilla_email_append.pl + Customation: There are some values inside the script which need to be customized for your @@ -74,4 +77,4 @@ There are two command line switches : 02/2000 - Klaas Freitag, SuSE GmbH 03/2000 - Seth M. Landsman bug_email.pl now lives out of bugzilla/contrib - added line about formail \ No newline at end of file + added line about formail diff --git a/contrib/bugzilla.procmailrc b/contrib/bugzilla.procmailrc new file mode 100644 index 000000000..36656b4d2 --- /dev/null +++ b/contrib/bugzilla.procmailrc @@ -0,0 +1,30 @@ +:0 fhw +| formail -I "From " -a "From " + +BUGZILLA_HOME=/home/bugzilla/WEB/bugzilla/contrib + +:0 +* ^Subject: .*\[Bug .*\] +RESULT=|(cd $BUGZILLA_HOME && ./bugzilla_email_append.pl) + + +# Feed mail to stdin of bug_email.pl +:0 Ec +#* !^Subject: .*[Bug .*] +RESULT=|(cd $BUGZILLA_HOME && ./bug_email.pl ) + +# write result to a logfile +:0 c +|echo `date '+%d.%m.%y %H:%M: '` $RESULT >> $HOME/bug_email.log + + +:0 c +|echo "----------------------------------" >> $HOME/bug_email.log + +:0 c +$HOME/bug_email.log + +# Move mail to the inbox +:0 +$HOME/Mail/INBOX + diff --git a/contrib/bugzilla_email_append.pl b/contrib/bugzilla_email_append.pl index 065e2aba2..b10d8e030 100755 --- a/contrib/bugzilla_email_append.pl +++ b/contrib/bugzilla_email_append.pl @@ -18,6 +18,7 @@ # Contributor : Seth M. Landsman # 03/15/00 : Initial version by SML +# 03/15/00 : processmail gets called # Email subject must be of format : # .* Bug ### .* @@ -26,7 +27,6 @@ # TODO : # 1. better way to get the body text (I don't know what dump_entity() is # actually doing -# 2. response emails use diagnostics; use strict; @@ -115,6 +115,8 @@ my $Body = "Subject: " . $Subject . "\n" . $Comment; my $long_desc_query = "INSERT INTO longdescs SET bug_id=$found_id, who=$userid, bug_when=NOW(), thetext=" . SqlQuote($Body) . ";"; SendSQL($long_desc_query); +system("cd .. ; ./processmail $found_id '$SenderShort'"); + sub DealWithError { my ($reason) = @_; print $reason . "\n"; -- cgit v1.2.3-24-g4f1b