Interesting, I just tried the same test you ran and got he following
(abbreviated) results:
...
Content-Disposition: inline
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
**
test mail
**
test mail
**
EOF
Is it possible that one of your other plugins is causing this problem? The
only plugins i'm running are this one, check_loop, and rcpt_ok. I guess it's
possible that there could be a bug in the $transaction->set_body_start() method
that could cause this problem, but it looks correct to me. I'm running version
0.32-6 as packaged by Debian.
Craig
On Fri, 25 May 2007 14:45:40 -0500, Tim Tsai <[EMAIL PROTECTED]> wrote:
> I am using swaks to do the testing, and the swaks output follows (I had
> examined the raw before message previously and it's fine - about to
> leave town so want to get this message out before I do). Note that it
> always does it to the first line of the body. I think Transaction.pm is
> suspect but I must be the only one that's seeing this, so it could be
> something related to my environment (Fedora Core 6).
>
> Thanks!!
>
> Tim
>
> [EMAIL PROTECTED] swaks --to [EMAIL PROTECTED] --port 2525
> === Trying xxxx:2525...
> === Connected to xxxx.
> <- 220 xxxx ESMTP qpsmtpd 0.33-dev ready; send us your mail, but not
> your spam.
> -> EHLO xxxx
> <- 250-xxxx Hi xxxx [xxx.xxx.xxx.xxx]
> <- 250-PIPELINING
> <- 250-8BITMIME
> <- 250 SIZE 50000000
> -> MAIL FROM:<[EMAIL PROTECTED]>
> <- 250 <[EMAIL PROTECTED]>, sender OK - how exciting to get mail from you!
> -> RCPT TO:<[EMAIL PROTECTED]>
> <- 250 <[EMAIL PROTECTED]>, recipient ok
> -> DATA
> <- 354 go ahead
> -> Date: Fri, 25 May 2007 14:36:57 -0500
> -> To: [EMAIL PROTECTED]
> -> From: [EMAIL PROTECTED]
> -> Subject: test Fri, 25 May 2007 14:36:57 -0500
> -> X-Mailer: swaks v20060621.0 jetmore.org/john/code/#swaks
> ->
> -> This is a test mailing
> ->
> -> .
> <- 250 Queued!
> -> QUIT
> <- 221 xxxx closing connection. Have a wonderful day.
>
> I inserted this code into spamassassin_filter:
>
> # Replace this transaction's message contents with the message returned
> # from spamc.
> $transaction->header($mail->head());
> $transaction->set_body_start();
> $transaction->body_write(join("", @{$mail->body()}));
>
> open MSG, ">/tmp/msg2";
> print MSG $transaction->header()->as_string();
> $transaction->body_resetpos();
> print MSG "**\n";
> print MSG join("", @{$mail->body()});
> print MSG "**\n";
> print MSG $transaction->body_as_string();
> print MSG "**\n";
> close MSG;
>
> and the result in /tmp/msg2:
>
> [EMAIL PROTECTED] more /tmp/msg2
> X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on xxxx
> X-Spam-Level:
> X-Spam-Status: No, score=-100.4 required=5.0
> tests=ALL_TRUSTED,NO_REAL_NAME,
> RAZOR2_CHECK,USER_IN_WHITELIST autolearn=unavailable version=3.1.8
> Received: from xxxx (HELO xxxx) (xxx.xxx.xxx.xxx) by
> xxxx (qpsmtpd/0.33-dev) with ESMTP; Fri, 25 May 2007 14:36:58
> -0500
> Date: Fri, 25 May 2007 14:36:57 -0500
> To: [EMAIL PROTECTED]
> From: [EMAIL PROTECTED]
> Subject: test Fri, 25 May 2007 14:36:57 -0500
> X-Mailer: swaks v20060621.0 jetmore.org/john/code/#swaks
> **
> This is a test mailing
>
> **
>
> **
>
> Craig Gallek wrote:
>> Could you send an example of the problem (a before and after raw message
> maybe)? The parsing of the spamc response is done by the perl
> Mail::Internet module, so as long as the response is well formed, you
> should get a valid message out of the plugin.
>>
>> Craig
>>
>> On Fri, 25 May 2007 11:24:06 -0500, Tim Tsai <[EMAIL PROTECTED]> wrote:
>>
>>> This is for Craig - I just joined the list and the web archive doesn't
>>> show e-mail addresses.
>>>
>>> I am trying out the spamassassin_filter plugin and it's exactly what I
>>> have been looking for. We have a very specific spamassassin setup and
>>> moving the configuration off the plugin itself is a great idea.
>>>
>>> I have noticed that the version as posted online munges the first line
>>> of the body though. Any ideas? I think it starts when the result is
>>> read back from spamc. I see the same problem with both .32 and Trunk
>>>
>>> Thanks!
>>>
>>> Tim