You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Joe Flowers <fl...@social.chass.ncsu.edu> on 2004/04/20 18:05:34 UTC

check_message_text(messageA) and quotes in messageA

Hello All! Please help me with this nagging problem....

sprintf(messageAforSA, "my $status = $spamobj->check_message_text(\"%s\");",
messageA);

If messageA has ANY quotation marks (") in it then, SpamAssassin will puke
up and say that
"Can't call method "Mail::SpamAssassin::PerMsgStatus::get_required_hits" on
an undefined value."

To get around this problem, I have replaced every " in messageA with ',
before sending it to check_message_text().
However, this cannot be optimal, as this would surely skew the test results
that the SpamAssassin developers have worked so hard to make right.

Any ideas how to escape the " marks properly? I'm skeptical that \" is the
way to go here and besides it seems sub-optimal to have to replace every
single " char in messageA with two chars (\").

As a possible alternative, how can I create a correct object from messageA
to feed to $spamobj->check() instead of $spamobj->check_message_text()?

Thanks!

Joe

P.S. More details:

SuSE Linux 9
SpamAssassin 2.63
perl -v: v5.8.1 built for i586-linux-thread-multi
uname -a: Linux spamtest 2.4.21-202-smp4G #1 SMP Fri Apr 2 21:32:50 UTC 2004
i686 i686 i386 GNU/Linux