]> git.somenet.org - irc/bugbot.git/blob - BotModules/BugzillaMailHandler.txt
some old base
[irc/bugbot.git] / BotModules / BugzillaMailHandler.txt
1 BugzillaMailHandler.pl is a script that takes in mail from a
2 Bugzilla installation and possibly reports information about that
3 mail to specified channels.
4
5 Basically, with BugzillaMailHandler.pl, you can use MozBot to inform
6 you about updates to bugs. For the Bugzilla project, we use this to
7 inform us whenever a bug is filed, whenever an attachment is added,
8 and whenever a bug is fixed. We also have it let us know about certain
9 flags, so that we can go handle those flags quickly.
10
11 To use BugzillaMailHandler.pl:
12
13 1) Start mozbot, and load the Bugzilla.bm module.
14
15 2) Set up your MTA (sendmail, postfix, exim, qmail, etc.) to pipe all
16    mail coming to a certain address into the script instead of a local
17    mailbox. 
18
19    Your MTA must be able to write to files owned by the user that mozbot
20    is running as. For example, on my local system, my mozbot is run
21    as a user called "mozbot." I run postfix, so I have postfix become
22    the "mozbot" user before running BugzillaMailHandler.pl.
23
24 3) Now, all bugmail coming in to BugzillaMailHandler will start producing
25    input in BotModules/.bugmail.log (a hidden file). Mail that isn't in
26    the standard Bugzilla format will be discarded. Mails that just have
27    comments, or just inform that a dependency has been RESOLVED will be
28    ignored.
29
30 4) Now, you need to tell your bot to start reporting certain Bugzilla
31    Products to certain channels. In the future, there will be a command
32    for this, but for now you have to do it manually. There is a variable
33    in the Bugzilla module called "productReportChannels." It's a hash --
34    the keys are names of products, and the values are comma-separated
35    lists of channels.
36
37 5)  Once you set that variable, your mozbot will start reporting changes
38     to the specified products, in the specified channels.
39
40     However, it won't report *all* changes -- it will only report the
41     changes to fields that are specified in the "reportFields" variable,
42     which is a list of fields. Most fields have the *name that they would
43     have in a Bugzilla email*, in the "What" column of the table where
44     the mail shows bug changes.
45
46     There are some special fields:
47
48     Attachment Flag - Any attachment flag change.
49     NewBug          - When a new bug is filed.
50     NewAttach       - When a new attachment is posted to a bug.
51
52 Now, your mozbot should be up and running and reporting the changes
53 that you want!
54
55 Other Notes
56 -----------
57
58 There are a few other features that you can use to fine-tune how MozBot
59 reports bug changes. First, anybody (not just a bot admin) can tell the
60 bot to temporarily stop reporting changes from a certain Bugzilla user:
61
62    ignore user@domain.com
63
64 And to turn back on notifications about that user:
65
66    unignore user@domain.com
67
68 There are also some variables you can use to configure how mozbot reports
69 changes, and what changes he reports:
70
71    channelMuteFields - A hash, where the key is the name of a channel, and
72                        the value is a comma-separated list of Fields, just
73                        like they would show up in the reportFields var.
74                        Changes to these fields will *not* be reported in
75                        the specified channels, but will still be reported
76                        in the other channels mozbot is configured to announce
77                        things to.
78
79    productMuteFields - A hash, where the key is the name of a Product in
80                        Bugzilla, and the value is a comma-separated list
81                        of Fields, just like they would show up in the
82                        reportFields var.
83                        Changes to the specified Fields on the specified
84                        products will not be reported to any channel, ever.
85
86    updateDelay       - How often mozbot checks for information in the
87                        .bugmail.log file. Usually you can keep this at the
88                        default, unless you want to increase it for some reason.
89
90 Questions about this functionality can be asked in #mozwebtools on
91 irc.mozilla.org.