<div dir="ltr"><div><div><div>Hi all,<br></div>Thanks for the responses, it's partially working. When I use my Email_Local.pm, the server refuses to start, yet I have no errors. Running it through Perl's checker reveals only:<br><br></div>Name "RT::Logger" used only once: possible typo at Email_Local.pm at line 31<br><br></div>Perl says everything else is fine. I pulled the single function I wanted to modify out of the original Email.pm (ParseTicketId) and left it alone, except for changing \s+ to \s* in the "if (my $@captures" line. As usual, any errors that might be generated are going who knows where, so I'm not sure where to start looking. As I said, Perl thinks this is fine save that warning, but RT definitely doesn't. Any thoughts? Here's the file:<br><br><br>use strict;<br>use warnings;<br>no warnings qw(redefine);<br><br>package RT::Interface::Email;<br><br>#Takes a string and searches for [subjecttag #id]<br><br>#Returns the id if a match is found. Otherwise returns undef.<br><br>sub ParseTicketId {<br> my $Subject = shift;<br><br> my $rtname = RT->Config->Get('rtname');<br> my $test_name = RT->Config->Get('EmailSubjectTagRegex') || qr/\Q$rtname\E/i;<br><br> # We use @captures and pull out the last capture value to guard against<br> # someone using (...) instead of (?:...) in $EmailSubjectTagRegex.<br> my $id;<br> if ( my @captures = $Subject =~ /\[$test_name\s*\#(\d+)\s*\]/i ) {<br> $id = $captures[-1];<br> } else {<br> foreach my $tag ( RT->System->SubjectTag ) {<br> next unless my @captures = $Subject =~ /\[\Q$tag\E\s+\#(\d+)\s*\]/i;<br> $id = $captures[-1];<br> last;<br> }<br> }<br> return undef unless $id;<br><br> $RT::Logger->debug("Found a ticket ID. It's $id");<br> return $id;<br>}<br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 31, 2016 at 12:18 PM, Nilesh <span dir="ltr"><<a href="mailto:me@nileshgr.com" target="_blank">me@nileshgr.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">To extend you should either add code in Email_Local.pm or Email_Overlay.pm. If you name it as Email.pm then you have to copy all code from existing module and modify it.</p>
<p dir="ltr">I'm not sure about differences between Overlay and Local but I think that difference is for OO vs adding some functionality.</p>
<p dir="ltr">--<br>
Nilesh</p>
<div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 31-Oct-2016 9:45 PM, "Matt Zagrabelny" <<a href="mailto:mzagrabe@d.umn.edu" target="_blank">mzagrabe@d.umn.edu</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hi Alex,<br>
<br>
On Mon, Oct 31, 2016 at 11:09 AM, Alex Hall <<a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a>> wrote:<br>
> Hey list,<br>
> How would I override /opt/rt4/lib/RT/Interface/Emai<wbr><a href="http://l.pm">l.pm</a>?<br>
<br>
Overlays.<br>
<br>
<a href="https://docs.bestpractical.com/rt/4.4.1/RT/StyleGuide.html#EXTENDING-RT-CLASSES" rel="noreferrer" target="_blank">https://docs.bestpractical.com<wbr>/rt/4.4.1/RT/StyleGuide.html#<wbr>EXTENDING-RT-CLASSES</a><br>
<br>
It looks like there is also an outdated wiki article:<br>
<br>
<a href="https://rt-wiki.bestpractical.com/wiki/ObjectModel" rel="noreferrer" target="_blank">https://rt-wiki.bestpractical.<wbr>com/wiki/ObjectModel</a><br>
<br>
-m<br></div></div>
---------<br>
RT 4.4 and RTIR training sessions, and a new workshop day! <a href="https://bestpractical.com/training" rel="noreferrer" target="_blank">https://bestpractical.com/trai<wbr>ning</a><br>
* Los Angeles - Q1 2017<br>
</blockquote></div></div>
<br>---------<br>
RT 4.4 and RTIR training sessions, and a new workshop day! <a href="https://bestpractical.com/training" rel="noreferrer" target="_blank">https://bestpractical.com/<wbr>training</a><br>
* Los Angeles - Q1 2017<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div>