diff -ur spamass-milter-0.3.1.orig/spamass-milter.cpp spamass-milter-0.3.1/spamass-milter.cpp --- spamass-milter-0.3.1.orig/spamass-milter.cpp 2006-03-24 06:41:36.000000000 +0900 +++ spamass-milter-0.3.1/spamass-milter.cpp 2008-01-02 19:41:44.000000000 +0900 @@ -392,7 +392,7 @@ } else if (newstring.size() > 0) { debug(D_UORI, "u_or_i: inserting"); - smfi_addheader(ctx, header, cstr); + smfi_insheader(ctx, 0, header, cstr); } } else { @@ -419,6 +419,7 @@ if (bob == string::npos) bob = assassin->d().size(); + update_or_insert(assassin, ctx, assassin->spam_virus(), &SpamAssassin::set_spam_virus, "X-Spam-Virus"); update_or_insert(assassin, ctx, assassin->spam_flag(), &SpamAssassin::set_spam_flag, "X-Spam-Flag"); update_or_insert(assassin, ctx, assassin->spam_status(), &SpamAssassin::set_spam_status, "X-Spam-Status"); @@ -1081,6 +1082,8 @@ assassin->set_spam_level(headerv); else if ( cmp_nocase_partial("X-Spam-Checker-Version", headerf) == 0 ) assassin->set_spam_checker_version(headerv); + else if ( cmp_nocase_partial("X-Spam-Virus", headerf) == 0 ) + assassin->set_spam_virus(headerv); else { /* Hm. X-Spam header, but not one we recognize. Pass it through. */ @@ -1646,6 +1649,12 @@ } string& +SpamAssassin::spam_virus() +{ + return x_spam_virus; +} + +string& SpamAssassin::content_type() { return _content_type; @@ -1778,6 +1787,14 @@ } string::size_type +SpamAssassin::set_spam_virus(const string& val) +{ + string::size_type old = x_spam_virus.size(); + x_spam_virus = val; + return (old); +} + +string::size_type SpamAssassin::set_content_type(const string& val) { string::size_type old = _content_type.size(); diff -ur spamass-milter-0.3.1.orig/spamass-milter.h spamass-milter-0.3.1/spamass-milter.h --- spamass-milter-0.3.1.orig/spamass-milter.h 2006-03-24 07:07:55.000000000 +0900 +++ spamass-milter-0.3.1/spamass-milter.h 2008-01-02 19:17:44.000000000 +0900 @@ -98,6 +98,7 @@ string& spam_prev_content_type(); string& spam_checker_version(); string& spam_level(); + string& spam_virus(); string& content_type(); string& subject(); string& rcpt(); /* first RCPT TO: recipient (raw) */ @@ -114,6 +115,7 @@ string::size_type set_spam_prev_content_type(const string&); string::size_type set_spam_checker_version(const string&); string::size_type set_spam_level(const string&); + string::size_type set_spam_virus(const string&); string::size_type set_content_type(const string&); string::size_type set_subject(const string&); string::size_type set_rcpt(const string&); @@ -140,6 +142,7 @@ // Variables for SpamAssassin influenced fields string x_spam_status, x_spam_flag, x_spam_report, x_spam_prev_content_type; string x_spam_checker_version, x_spam_level, _content_type, _subject; + string x_spam_virus; // Envelope info: MAIL FROM:, RCPT TO:, and IP address of remote host // _rcpt only holds the first recipient if there are more than one