<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Thanks Jannae, it works like a charm!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 16, 2016 at 10:11 PM, Jannae Jacks <span dir="ltr"><<a href="mailto:jannae@nyu.edu" target="_blank">jannae@nyu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Hugo, <div><br></div><div>The N in Filename is not capitalized in the docs. Try lowercase? </div><div><br></div><div>ttps://<a href="http://docs.bestpractical.com/rt/4.4.0/RT/Attachment.html#Filename" target="_blank">docs.bestpractical.com/rt/4.4.0/RT/Attachment.html#Filename</a></div><div><br></div><div>Like so:</div><div><br></div><div><div class="gmail_default" style="font-size:12.8px"><span class=""><div class="gmail_default" style="font-family:monospace,monospace"><font color="#0000ff">while(my $attachment = $self->TransactionObj->Attachments->Next) {</font></div></span><div class="gmail_default" style="font-family:monospace,monospace"><font color="#0000ff"><span style="white-space:pre-wrap"> </span>$RT::Logger->info($attachment->Filename);</font></div><div class="gmail_default" style="font-family:monospace,monospace"><font color="#0000ff">}</font></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div><font color="#0000ff"><br></font></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Mar 16, 2016 at 1:01 PM, Hugo Escobar <span dir="ltr"><<a href="mailto:hescobar@afslc.com" target="_blank">hescobar@afslc.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Update:</div><div class="gmail_default" style="font-family:monospace,monospace">The following lines work exactly as I expect:</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">use Data::Dumper; </font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff"><br></font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">my $tobj = $self->TransactionObj;</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">my $atts = $tobj->Attachments;</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff"><br></font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">my $attachment = $self->TransactionObj->Attachments->Next;</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">if (!$attachment) {</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff"> return 0;</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">}</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff"><br></font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">my $content = Dumper($attachment->ContentAsMIME(Children=>1));</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">if ($content=~/ name\=\".*?\.zip\"/i) {</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff"> $RT::Logger->info("message has a zip file");</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">} else {</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff"> $RT::Logger->info("no zip file");</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">}</font></div><div class="gmail_default"><font face="monospace, monospace" color="#0000ff">return 1;</font></div></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">However, this doesn't look like a good solution</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">In an attempt to use the API directly, I tried the following:</div><div class="gmail_default"><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default"><div class="gmail_default" style="font-family:monospace,monospace"><a href="https://docs.bestpractical.com/rt/4.2.12/RT/Attachment.html#Filename" target="_blank">https://docs.bestpractical.com/rt/4.2.12/RT/Attachment.html#Filename</a></div><div class="gmail_default"><font face="monospace, monospace"><a href="https://docs.bestpractical.com/rt/4.2.12/RT/Transaction.html#Attachments" target="_blank">https://docs.bestpractical.com/rt/4.2.12/RT/Transaction.html#Attachments</a></font><br></div></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><font color="#0000ff">while(my $attachment = $self->TransactionObj->Attachments->Next) {</font></div><div class="gmail_default" style="font-family:monospace,monospace"><font color="#0000ff"><span style="white-space:pre-wrap"> </span>$RT::Logger->info($attachment->FileName);</font></div><div class="gmail_default" style="font-family:monospace,monospace"><font color="#0000ff">}</font></div></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">But got this in the log file:</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><div class="gmail_default">[Wed Mar 16 16:47:07 2016] [error]: Scrip 34 Commit failed: RT::Attachment::FileName Unimplemented in RT::Action::UserDefined. ((eval 652) line 2)</div><div><br></div></div><div class="gmail_extra"><div class="gmail_default" style="font-family:monospace,monospace">any ideas?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Thanks in advance</div><br></div><div class="gmail_extra"><div class="gmail_default" style="font-family:monospace,monospace">PS:</div><div class="gmail_default" style="font-family:monospace,monospace">our installation:</div><div class="gmail_default" style="font-family:monospace,monospace">Centos 6.6/MySql/Apache+mod_perl</div><div class="gmail_default" style="font-family:monospace,monospace">RT 4.2.9</div><br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 15, 2016 at 7:04 PM, Hugo Escobar <span dir="ltr"><<a href="mailto:hescobar@afslc.com" target="_blank">hescobar@afslc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:monospace,monospace">Hi,</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">I need to detect if a zip file has been attached to a ticket at</div><div style="font-family:monospace,monospace">creation time and also at 'comment' or 'correspond' time.</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">My idea to solve this is to extract the attachments and then parse</div><div style="font-family:monospace,monospace">the content.</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">I think the best route for this would be:</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace"> TransactionObj->Attachments->Next ... </div><div style="font-family:monospace,monospace"> ContentAsMIME(Children=>1)<br></div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">Since MIME entities can themselves contain other entities,</div><div style="font-family:monospace,monospace">I think I'm going to need a recursive function ...</div><div style="font-family:monospace,monospace"><br></div><div style="font-family:monospace,monospace">Basically what I'd like is a few words of advice. I think I can</div><div style="font-family:monospace,monospace">come up with a solution but perhaps there's a simpler path I'm overlooking or I'm not aware of.</div><div><br></div><div><div style="font-family:monospace,monospace">Thanks in advance,</div></div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Regards,<br><br>Hugo Escobar<br><br>
<div><a href="http://www.associationfinancialservices.com/" target="_blank"><img src="cid:part1.02030600.00030308@enflyer.com" height="26" width="126" border="0"></a><br><br></div>4770 Biscayne Blvd, Ste 700<br>Miami, FL 33137<br>
<br>main: <a href="tel:305.677.0022" value="+13056770022" target="_blank">305.677.0022</a><br>support: <a href="tel:305.921.4620" value="+13059214620" target="_blank">305.921.4620</a><br>email: <a href="mailto:hescobar@afslc.com" target="_blank">hescobar@afslc.com</a><br><br>Follow us on Facebook and Linked-In<br>
<div><a href="http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864" target="_blank"><img alt="" src="cid:part1.08060004.03030107@enflyer.com" height="24" width="24" border="0"></a> <a href="http://www.linkedin.com/companies/1006276" target="_blank"><img alt="" src="cid:part2.00090205.04060608@enflyer.com" height="24" width="24" border="0"></a> </div>
<br>NOTICE: This email and any attachment to this email may contain
confidential information. If you are not the intended recipient, you
must not review, retransmit, convert to hard copy, photocopy, use or
disseminate this email or any attachments to it. If you have received
this email in error, please notify us immediately by return email and
delete this message. Please note that if this email contains a forwarded
message or is a reply to a prior message, some or all of the contents
of this message or any attachments may not have been produced by our
firm. <b>As our firm may be deemed a debt collector, if your payment is
in default, we may be attempting to collect a debt on behalf of the
association, and any information obtained may be used for that purpose.</b><br></div></div>
</div></div></div></div>
<br></div></div>---------<br>
RT 4.4 and RTIR Training Sessions <a href="https://bestpractical.com/training" rel="noreferrer" target="_blank">https://bestpractical.com/training</a><br>
* Washington DC - May 23 & 24, 2016<br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8000001907349px">Jannae Jacks</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Senior Network Security Analyst, Technology Security Services</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">New York University, Information Technology</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">726 Broadway, 2nd Floor, New York, NY 10003</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><a href="http://www.nyu.edu" target="_blank">http://www.nyu.edu</a></span><div style="font-size:12.8000001907349px"><br>p: (212) 992.7444 | m: (901) 229.3225</div></div></div></div></div></div></div></div></div>
</font></span></div>
<br>---------<br>
RT 4.4 and RTIR Training Sessions <a href="https://bestpractical.com/training" rel="noreferrer" target="_blank">https://bestpractical.com/training</a><br>
* Washington DC - May 23 & 24, 2016<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Regards,<br><br>Hugo Escobar<br><br>
<div><a href="http://www.associationfinancialservices.com/" target="_blank"><img src="cid:part1.02030600.00030308@enflyer.com" height="26" width="126" border="0"></a><br><br></div>4770 Biscayne Blvd, Ste 700<br>Miami, FL 33137<br>
<br>main: 305.677.0022<br>support: 305.921.4620<br>email: <a href="mailto:hescobar@afslc.com" target="_blank">hescobar@afslc.com</a><br><br>Follow us on Facebook and Linked-In<br>
<div><a href="http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864" target="_blank"><img alt="" src="cid:part1.08060004.03030107@enflyer.com" height="24" width="24" border="0"></a> <a href="http://www.linkedin.com/companies/1006276" target="_blank"><img alt="" src="cid:part2.00090205.04060608@enflyer.com" height="24" width="24" border="0"></a> </div>
<br>NOTICE: This email and any attachment to this email may contain
confidential information. If you are not the intended recipient, you
must not review, retransmit, convert to hard copy, photocopy, use or
disseminate this email or any attachments to it. If you have received
this email in error, please notify us immediately by return email and
delete this message. Please note that if this email contains a forwarded
message or is a reply to a prior message, some or all of the contents
of this message or any attachments may not have been produced by our
firm. <b>As our firm may be deemed a debt collector, if your payment is
in default, we may be attempting to collect a debt on behalf of the
association, and any information obtained may be used for that purpose.</b><br></div></div>
</div>