RT::Ex...ByMail(3pm)

πŸ“¦ version 3.01, in debian trixie, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

RT::Extension::CommandByMail β€” the glow-up that lets you change ticket metadata via email. Yep, fr. You just send an email and the ticket does what you said. πŸ’…


✨ RT VERSION ✨

It works with RT 4.0, 4.2, 4.4, 5.0. That's the whole range bestie, she's versatile. πŸ¦‹


πŸ’Œ SYNOPSIS πŸ’Œ

So you send an email with content that looks like the following:

Status: stalled
Subject: change subject
AddAdminCc: boss@example.com
AddCc: dev1@example.com
AddCc: dev2@example.com

The comment/reply text goes here

Like, that's it. That's the whole vibe. The ticket wakes up changed. ✨


🚨 IMPORTANT 🚨

Okay so for the girlies using versions of this extension prior to 3.0: heads up, you will not get an unknown command error email for unknown commands anymore. Rude? Maybe. But there will be a warning in the logs whenever an unknown command shows up. A setting was added to bring back the old behavior β€” see the setting $CommandByMailErrorOnUnknown under "Configuration" for the details. 🫢


πŸ› οΈ INSTALLATION πŸ› οΈ

Run these, in this order:

perl Makefile.PL
make
make install
May need root permissions πŸ‘‘

Then edit your /opt/rt5/etc/RT_SiteConfig.pm.

If you're on RT 4.2 or greater, add this line:

Plugin('RT::Extension::CommandByMail');

For RT 4.0, add this line instead:

Set(@Plugins, qw(RT::Extension::CommandByMail));

or just add RT::Extension::CommandByMail to your existing @Plugins line. Either way bestie, she's in.

For RT 4.2 or older, you also need to add Filter::TakeAction to your @MailPlugins configuration, like this:

Set(@MailPlugins, qw(Auth::MailFrom Filter::TakeAction));

For RT 4.4 or newer, the plugin code lives in Action::CommandByMail, so add this:

Set(@MailPlugins, qw(Auth::MailFrom Action::CommandByMail));

Be sure to include Auth::MailFrom in the list as well β€” don't skip her, she matters. 🫢

Note: The plugin name 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. Not me reminding you twice, but also yes me reminding you twice. 😭

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 πŸ”„ β€” yes, actually restart it, don't just think about it.


βš™οΈ CONFIGURATION βš™οΈ

On top of adding the configuration above to activate the extension in RT, the following options are available. Look at her go. πŸ‘‘

πŸ’– $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. It's giving ✨exclusive✨.

πŸ’– $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. Body? Never heard of her. πŸ™ˆ

πŸ’– $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. Nostalgia, but make it a config value. πŸ•°οΈ


⚠️ CAVEATS ⚠️

This extension is incompatible with the UnsafeEmailCommands RT option. They cannot coexist bestie, it's one or the other. πŸ’€


πŸ“– 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. Main character energy honestly. 🌟

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. So no fancy formatting, she's reading plain text only. πŸ“

🌸 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. Slay. πŸ’…

🌈 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 adds time to the current value.

TimeWorked: <minutes>
TimeEstimated: <minutes>
TimeLeft: <minutes>

πŸ‘€ Watchers πŸ‘€

Manage watchers: requestors, ccs and admin ccs. This commands can be used several times and/or with Add and Del prefixes, for example Requestor command set requestor(s) and the current requestors would be deleted, but AddRequestor command adds to the current list.

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

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. No extra gatekeeping here, she trusts RT's own locks. πŸ”


🧠 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. Multitasking icon. πŸ‘‘

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 <modules@bestpractical.com>


πŸ› BUGS πŸ›

All bugs should be reported via email to

L<bug-RT-Extension-CommandByMail@rt.cpan.org|mailto:bug-RT-Extension-CommandByMail@rt.cpan.org>

or via the web at

L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-CommandByMail>.

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

okay bestie that's the whole page, you ate it πŸ’…βœ¨ This was RT::Ex...ByMail(3pm) from the User Contributed Perl Documentation, running on perl v5.40.1, dated 2025-03-16. Go forth and command your tickets by mail, no cap. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from