-
Notifications
You must be signed in to change notification settings - Fork 5
/
README
266 lines (195 loc) · 9.14 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
NAME
RT::Extension::CommandByMail - Change ticket metadata via email
RT VERSION
Works with RT 4.4, 5.0
SYNOPSIS
(Send email with content that looks like the following.)
Status: stalled
Subject: change subject
AddAdminCc: [email protected]
AddCc: [email protected]
AddCc: [email protected]
The comment/reply text goes here
IMPORTANT
For users of versions of this extension prior to 3.0: Please note that
now you will not receive an unknown command error email for unknown
commands. There will be a warning in the logs whenever an unknown
command is encountered. A setting was added to restore the previous
behavior. See the setting $CommandByMailErrorOnUnknown under
"Configuration" for more information.
INSTALLATION
perl Makefile.PL
make
make install
May need root permissions
Edit your /opt/rt5/etc/RT_SiteConfig.pm
If you are using RT 4.2 or greater, add this line:
Plugin('RT::Extension::CommandByMail');
For RT 4.0, add this line:
Set(@Plugins, qw(RT::Extension::CommandByMail));
or add RT::Extension::CommandByMail to your existing @Plugins line.
For RT 4.2 or older, also add Filter::TakeAction to your
@MailPlugins configuration, as follows:
Set(@MailPlugins, qw(Auth::MailFrom Filter::TakeAction));
For RT 4.4 or newer, the plugin code is in Action::CommandByMail, so
add this:
Set(@MailPlugins, qw(Auth::MailFrom Action::CommandByMail));
Be sure to include Auth::MailFrom in the list as well.
Note: The plugin name has changed for RT 4.4, so after upgrading you
must also update your RT_SiteConfig.pm file to change
Filter::TakeAction to the new Action::CommandByMail.
Patch RT
For RT 4.4.0, apply the included patch:
cd /opt/rt4 # Your location may be different
patch -p1 < /download/dir/RT-Extension-CommandByMail/etc/handle_action_pass_currentuser.patch
Restart your webserver
CONFIGURATION
In addition to adding the configuration above to activate the extension
in RT, the following options are available.
$CommandByMailGroup
You may set a $CommandByMailGroup to a particular group ID in
RT_SiteConfig. If set, only members of this group may perform commands
by mail.
$CommandByMailHeader
You may set this configuration value to the name of a header to examine
as well. For example:
Set($CommandByMailHeader, "X-RT-Command");
$CommandByMailOnlyHeaders
If set, the body will not be examined, only the header defined by the
previous configuration option.
$CommandByMailErrorOnUnknown
Prior to 2.02, this extension throws an error if it finds an unknown
command. This is no longer the case. Setting this option will restore
that legacy behavior.
CAVEATS
This extension is incompatible with UnsafeEmailCommands RT option.
DESCRIPTION
This extension allows you to manage ticket metadata via email. You may
put commands into the beginning of an email, and the extension will
apply them. The list of commands is detailed below.
CAVEAT: commands are line oriented, so you can't expand to multiple
lines for each command, i.e. values can't contains new lines. The module
also currently expects and parses text, not HTML.
FORMAT
This extension parses the body, and optionally a header, in incoming
messages for commands to update ticket metadata. The format of commands
is:
Command: value
Command: value
...
You can find list of "COMMANDS" below.
Some commands (like Status, Queue and other) can be used only once.
Commands that manage lists can be used multiple times, for example link,
custom fields and watchers commands. Also, the latter can be used with
Add and Del prefixes to add/delete values from the current list of the
ticket you reply to or comment on.
COMMANDS
Basic
Queue: <name>
Set new queue for the ticket
Subject: <string>
Set new subject to the given string
Status: <status>
Set new status, one of new, open, stalled, resolved, rejected or
deleted
Owner: <username>
Set new owner using the given username
Priority: <#>
Set new priority to the given value
FinalPriority: <#>
Set new final priority to the given value
Dates
Set new date/timestamp, or 0 to unset:
Due: <new timestamp>
Starts: <new timestamp>
Started: <new timestamp>
Time
Set new times to the given value in minutes. Note that on
correspond/comment TimeWorked add time to the current value.
TimeWorked: <minutes>
TimeEstimated: <minutes>
TimeLeft: <minutes>
Watchers
Manage watchers: requestors, ccs and admin ccs. These commands can be
used several times and/or with Add and Del prefixes, for example
Requestor comand set requestor(s) and the current requestors would be
deleted, but AddRequestor command adds to the current list. For groups,
you must prefix the group name with group:. For example, AddAdminCc:
group:MyGroupname.
Requestor: <address> Set requestor(s) using the email address
AddRequestor: <address> Add new requestor using the email address
DelRequestor: <address> Remove email address as requestor
Cc: <address> Set Cc watcher(s) using the email address
AddCc: <address> Add new Cc watcher using the email address
DelCc: <address> Remove email address as Cc watcher
AdminCc: <address> Set AdminCc watcher(s) using the email address
AddAdminCc: <address> Add new AdminCc watcher using the email address
DelAdminCc: <address> Remove email address as AdminCc watcher
Custom Roles
Manage custom roles of the ticket. These commands can be used several
times and/or with Add and Del prefixes. If you have a Custom Role called
Customer for example, you can pass the command CustomRole.{Customer} to
set the members of that role. You can pass either a username or an email
address. For groups, you must prefix the group name with group:. For
example, CustomRole.{Customer}: group:MyGroupname.
CustomRole.{Customer}: set the members of the Customer Custom Role
AddCustomRole.{Customer}: add members to the Customer Custom Role
DelCustomRole.{Customer}: remove members from the Customer Custom Role
Replace Customer with the name of your Custom Role.
Links
Manage links. These commands are also could be used several times in one
message.
DependsOn: <ticket id>
DependedOnBy: <ticket id>
RefersTo: <ticket id>
ReferredToBy: <ticket id>
Members: <ticket id>
MemberOf: <ticket id>
Custom field values
Manage custom field values. Could be used multiple times. (The curly
braces are literal.)
CustomField.{<CFName>}: <custom field value>
AddCustomField.{<CFName>}: <custom field value>
DelCustomField.{<CFName>}: <custom field value>
Short forms:
CF.{<CFName>}: <custom field value>
AddCF.{<CFName>}: <custom field value>
DelCF.{<CFName>}: <custom field value>
Transaction Custom field values
Manage custom field values of transactions. Could be used multiple
times. (The curly braces are literal.)
TransactionCustomField.{<CFName>}: <custom field value>
Short forms:
TxnCustomField.{<CFName>}: <custom field value>
TransactionCF.{<CFName>}: <custom field value>
TxnCF.{<CFName>}: <custom field value>
SECURITY
This extension has no extended auth system; so all security issues that
apply to the RT in general also apply to the extension.
METHODS
ProcessCommands
This method provides the main email processing functionality. It
supports both RT 4.2 and earlier and 4.4 and later. To do this, the
return hashes contain some values used by 4.2 code and some used by 4.4.
The return values coexist and unused values are ignored by the different
versions.
For 4.4, returning { DeferToRT => 1 } invokes the normal RT mail
processing flow. This allows CommandByMail to pass on processing an
email message for cases like a user not being a member of
CommandByMailGroup.
ParseCcAddressesFromHead HASH
Takes a hash containing QueueObj, Head and CurrentUser objects. Returns
a list of all email addresses in the To and Cc headers b<except> the
current Queue's email addresses, the CurrentUser's email address and
anything that the configuration sub RT::IsRTAddress matches.
AUTHOR
Best Practical Solutions, LLC <[email protected]>
BUGS
All bugs should be reported via email to
L<[email protected]|mailto:[email protected]>
or via the web at
L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-CommandByMail>.
LICENSE AND COPYRIGHT
This software is Copyright (c) 2014-2020 by Best Practical Solutions
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991