On Sunday 15 October 2006 20:49, Magnus Holmgren took the opportunity to say: > Apparently, when sa-learn reads a message from stdin, for some reason the > entire header, and possibly even the empty line separating it from the > body, disappears. Or at least $msg->get_header("Date") and > $msg->get_header("Received") in get_msgid() in Bayes.pm return undef or ''. > When I give sa-learn a filename it works. Also, learning via the TELL spamd > method works, as does spamassassin -r with filename as well as stdin.
I found the reason now. Mail::SpamAssassin::ArchiveIterator::scan_file() consumes the headers from STDIN. A normal file is read from the start the next time, but not standard input. '-' can't be treated like any other file. The reason that it works in 3.0.3 is that $self->{opt_n} is set, but in 3.1.4 there is $opt->{opt_want_date}, which is 1 by default and causes $self->{determine_receive_date} to be true as well. -- Magnus Holmgren [EMAIL PROTECTED] (No Cc of list mail needed, thanks)
pgpKixQ4SBsID.pgp
Description: PGP signature