[Rt-devel] rt-mailgate issue: Empty Tickets created if Attachment insert fails

Andrés Schiavo andresschiavo at gmail.com
Mon Jul 12 15:58:50 EDT 2010


I'm sorry, the last patch for rt-mailgate was wrong...this one works fine.
Best regards.
Andres.


--- rt-mailgate.orig    2010-07-12 11:13:10.000000000 +0200
+++ rt-mailgate 2010-07-12 21:54:14.000000000 +0200
@@ -61,6 +61,7 @@
 $DYNAMIC_FILE_UPLOAD = 1;

 use constant EX_TEMPFAIL => 75;
+use constant EX_UNKNOWERR => 76;
 use constant BUFFER_SIZE => 8192;

 my %opts;
@@ -131,7 +132,9 @@
 my $content = $r->content;
 print STDERR $content ."\n" if $opts{'debug'};

-if ( $content !~ /^(ok|not ok)/ ) {
+if ( $content =~ /^(ok)/ ) {
+    exit;
+} elsif ( $content =~ /^(not ok)/ ) {

     # It's not the server's fault if the mail is bogus. We just want to
know that
     # *something* came out of the server.
@@ -145,9 +148,16 @@
 EOF

     exit EX_TEMPFAIL;
-}
+} else {
+
+    print STDERR <<EOF;
+RT server error.
+
+The RT server sends an unexpected error.
+EOF

-exit;
+    exit EX_UNKNOWERR;
+}

 END {
     unlink $message{'filename'} if $message{'filename'};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-devel/attachments/20100712/15f6b850/attachment.html>


More information about the rt-devel mailing list