I dug deeper into the problem of why I was not getting the X-Spam-Relay-Countries header added to my mail, and I think I understand things a bit better. (The goal is to see what countries the few false negatives are going through.)

First of all, the correct add_header command seems to not be:
   add_header all Relay-Country _RELAYCOUNTRY_

Instead, it should be:
   add_header all Relay-Countries _RELAYCOUNTRY_

I saw that the plugin was active by running spamassassin -D.

Also, by running spamassassin manually with a known piece of spam, I could see the X-Spam-Relay-Countries header being added but not when I ran spamc through sendmail/spamass-milter.

The problem was that the headers were not be passed through by (drum roll please): spamass-milter even though I am *not* using the -M option. Also, I am using spamass-milter to reject mail during reception (via -r 5)

I'm not looking for spamass-milter support from here (unless someone knows what to do), but I do like the way my system works and I'd like to continue using a milter to reject the spam. Are other people using milters with sendmail that don't suffer from this problem?

TIA

On Monday, Jul 7th 2008 at 05:41 -0000, quoth Justin Mason:

=>
=>Matus UHLAR - fantomas writes:
=>> On 06.07.08 23:09, Steven W. Orr wrote:
=>> > Should I expect to see X-Relay-Countries as an added header in my
=>> > unrejected mail or is that only added to rejected mail? (Right now I do
=>> > not see anything in the accepted mail.)
=>>
=>> you should see it in any mail I'd say. It is only used for bayes DB and
=>> someone was trying to make a filter that will count number of different
=>> countries the mail travelled through...
=>
=>No.  You will only see it if you add the appropriate "add_header" line.

Ok. I just modified my setup but no joy. The current configuration is
below. Also, messages are coming through with:

X-Spam-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_60,RDNS_NONE
    autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
    saturn.syslang.net

Is there anything obvious I'm missing?

TIA


In init.pre:
# Uncommented
loadplugin Mail::SpamAssassin::Plugin::RelayCountry

In 00_add_headers.cf:

clear_headers
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on 
_HOSTNAME_
add_header spam Flag _YESNOCAPS_
add_header spam Level _STARS(*)_
add_header all Status "_YESNO_, score=_SCORE_ \
        required=_REQD_ tests=_TESTS_ \
        autolearn=_AUTOLEARN_ \
        version=_VERSION_"
add_header spam RBL _RBL_
add_header spam Spammy _SPAMMYTOKENS(2.long)_


ifplugin Mail::SpamAssassin::Plugin::RelayCountry
   add_header all Relay-Country _RELAYCOUNTRY_
endif # Mail::SpamAssassin::Plugin::RelayCountry

In 00_plugins_RelayCountry.cf:
ifplugin Mail::SpamAssassin::Plugin::RelayCountry
    # put loadplugin Mail::SpamAssassin::Plugin::RelayCountry in init.pre
    header      RELAYCOUNTRY_CN X-Relay-Countries =~ /\bCN\b/
    describe    RELAYCOUNTRY_CN Relayed through china
    score       RELAYCOUNTRY_CN 1.0

    header      RELAYCOUNTRY_KR X-Relay-Countries =~ /\bKR\b/
    describe    RELAYCOUNTRY_KR Relayed through Korea
    score       RELAYCOUNTRY_KR 1.0

    header      RELAYCOUNTRY_RU X-Relay-Countries =~ /RU/
    describe    RELAYCOUNTRY_RU Relayed through Russian Federation
    score       RELAYCOUNTRY_RU 2.0

    header      RELAYCOUNTRY_BR X-Relay-Countries =~ /BR/
    describe    RELAYCOUNTRY_BR Relayed through Brazil
    score       RELAYCOUNTRY_BR 2.0

    header      RELAYCOUNTRY_TR X-Relay-Countries =~ /TR/
    describe    RELAYCOUNTRY_TR Relayed through Turkey
    score       RELAYCOUNTRY_TR 2.0
endif # Mail::SpamAssassin::Plugin::RelayCountry



--
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

Reply via email to