This queue is for tickets about the RT-Extension-CommandByMail CPAN distribution.

Report information
The Basics
Id:
31795
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
francois [...] ctrlaltdel.ch
Cc:
AdminCc:

BugTracker
Severity:
Wishlist
Broken in:
(no value)
Fixed in:
(no value)

Attachments
RT-Extension-CommandByMail-command-strip-out-0.16.diff RT-Extension-CommandByMail-command-strip-out.diff



Subject: [Patch] New configuration option: CommandByMailStripOut
Attached patch adds a new configuration option CommandByMailStripOut which allows commands to be stripped out from the mail content.
Subject: RT-Extension-CommandByMail-command-strip-out.diff
diff -ur RT-Extension-CommandByMail-0.05/lib/RT/Interface/Email/Filter/TakeAction.pm RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm =================================================================== --- RT-Extension-CommandByMail-0.05/lib/RT/Interface/Email/Filter/TakeAction.pm (revision 826) +++ RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm (revision 1105) @@ -172,9 +172,11 @@ } my @content; + my $body; my @parts = $args{'Message'}->parts_DFS; + foreach my $part (@parts) { - my $body = $part->bodyhandle or next; + $body = $part->bodyhandle or next; #if it looks like it has pseudoheaders, that's our content if ( $body->as_string =~ /^(?:\S+):/m ) { @@ -205,6 +207,23 @@ } } + # Strip out commands from content if configuration says so + if ($RT::CommandByMailStripOut) { + my @content = $body->as_lines; + my $io = $body->open("w") or die "Cannot open body"; + + my $body_top = 1; + foreach my $line (@content) { + # Strip out commands only at the top + next if ($body_top && $line =~ /^(?:(\S+)\s*?:\s*?(.*)\s*?|)$/); + $body_top = 0; + + $io->print($line); + } + + $io->close() or die "Cannot close body"; + } + my %results; foreach my $cmd ( keys %cmds ) {
Subject: [rt.cpan.org #31795] patch against v0.16
Date: Wed, 05 Mar 2014 19:14:54 +0000
To: bug-RT-Extension-CommandByMail@rt.cpan.org
From: Simon Wilcox <simonw@simonwilcox.co.uk>
Hi, Here's a slightly revised patch that applies cleanly against v0.16 (latest as of 05 March 2014) I hope someone finds it useful. Simon.

Message body is not shown because sender requested not to inline it.



This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.