Hello,

I am trying to use OTRS filtering features, that allows to use
custom external script for filtering. I am talking about 
Ticket -> Core::PostMaster -> PostMaster::PreFilterModule###4-CMD:
configuration option.

But it looks like that PostMasterPOP3.pl script dies with "Broken pipe"
error when filter meets message larger than 65535 characters:


$ /usr/local/otrs/bin/PostMasterPOP3.pl
Message 1/54 ([EMAIL PROTECTED])
Broken pipe


And it is not script problem - I tried to substitute a dummy script, that just
logs time of execution and exits, and there was "Broken pipe" still.

To have a quick workaround, I patched Kernel/System/PostMaster/Filter/CMD.pm
to check current message size and skip filter if it is larger than 64k:

--- CMD.pm.orig Thu Jan 17 18:04:58 2008
+++ CMD.pm      Thu Jan 17 17:44:58 2008
@@ -57,7 +57,8 @@
     }
     # execute prog
     my $TmpFile = 
$Self->{ConfigObject}->Get('TempDir')."/PostMaster.Filter.CMD.$$";
-    if (open(PROG, "|$Config{CMD} > $TmpFile")) {
+    my $PlainEmail = $Self->{ParseObject}->GetPlainEmail();
+    if ((length($PlainEmail) <= 65536) and open(PROG, "|$Config{CMD} > 
$TmpFile")) {
         print PROG $PlainEmail;
         close (PROG);
     }

Test perl script that uses pipes works fine on my system:

$ cat pipetest.pl
#!/usr/bin/perl -w

    my $PlainEmail = "T"x10000000;
    open(PROG, "|/usr/home/otrs/bin/if-letter-is-spam-adv.awk > /tmp/cronfy");
    print PROG $PlainEmail;
    close (PROG);

So this is some OTRS-related problem.

Did anyone meet this? Any ideas?

Thanks in advance.

-- 
Cronfy.
_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support or consulting for your OTRS system?
=> http://www.otrs.com/

Reply via email to