Lista de Discussão cgpsa-discuss@mail.tffenterprises.com Mensagem #4275
De: Palvelin Postmaster <cgpsa-discuss@mail.tffenterprises.com>
Assunto: Re: [CGPSA] Delivering spam to Junk mailbox of each recipient
Data: Tue, 29 May 2018 12:52:27 +0300
Para: CGPSA Discussion List <cgpsa-discuss@mail.tffenterprises.com>


> On 29 May 2018, at 10:53, Patrick Sneyers <cgpsa-discuss@mail.tffenterprises.com> wrote:
>
>
>
>> Op 29 mei 2018, om 09:09 heeft Palvelin Postmaster <cgpsa-discuss@mail.tffenterprises.com> het volgende geschreven:
>>
>>
>>> On 29 May 2018, at 9:37, Patrick Sneyers <cgpsa-discuss@mail.tffenterprises.com> wrote:
>>>
>>>> Op 29 mei 2018, om 08:17 heeft Palvelin Postmaster <cgpsa-discuss@mail.tffenterprises.com> het volgende geschreven:
>>>>
>>>> Hi,
>>>>
>>>> I have a system-wide rule which delivers all recognized spam addressed to all domains and recipients to one centralized spam folder (of an account created exclusively for this purpose) for temporary storage and teaching SpamAssassin’s bayes filter.
>>>>
>>>> I’m considering changing my strategy to having a per-user spam folder instead. I’m thinking this could, at the very least, empower the users to actually receive these messages and manage possible false positives.
>>>>
>>>> Does anyone have any experience or insights about the strengths and weaknesses of alternate handling strategies?
>>>>
>>>> What would be the best way to implement this? Do I just need to make a ’Store In’ domain-wide rule for each domain instead of the single system-wide rule I have now?
>>>>
>>>
>>> You can use this option in cgpsa.conf (line 552 in my file), and keep using the server wide rule.
>>
>> Ahh…I had forgotten about that. Thanks for the reminder! :)
>>
>> So, here’s my current server-wide processing rule. Do I just need to delete the ’Store In’ action and tweak the cgpsa.conf dma settings?
>>
>> Subject is *SPAM-PALVELIN*
>> Header Field is X-Spam-Flag: YES*
>>
>> Add Header
>> X-Spam-Global: YES
>> Write To Log
>> Spam (GLOBAL) Detected
>> Store In
>> ~spam/Junk-SpamAssassin
>> Discard
>
> After setting dma in cgpsa.conf (and restarting extfilter), you can disable that rule completely. Just keep the one above, with the "ExternalFilter =  cgpsa" action.

”…the one above”?


>>> Of course, learning spam/ham becomes a bit more complicated then.
>>
>> Do you mean in a technical or practical sense? I currently have a script which learns spam daily from all folders which follow specified naming conventions (Junk*, Spam*, etc.). I don’t see a need to make any changes to it.
>
> Then you're all set!
> Would you be willing to share that script? :)

Sure, but this is very crude. :)

#!/bin/bash

maildir="/var/CommuniGate"

# Learn all mbox's in CGP default locations where name indicated a spam mailbox

for SpamBox in $maildir/Accounts/*/Junk*.mbox;
        do
                /opt/local/bin/sa-learn --spam --no-sync --mbox "$SpamBox";
                echo "Processed spam mailbox $SpamBox";
        done

for SpamBox in $maildir/Accounts/*/Roskaposti*.mbox;
        do
            /opt/local/bin/sa-learn --spam --no-sync --mbox "$SpamBox";
            echo "Processed spam mailbox $SpamBox";
        done

for SpamBox in $maildir/Accounts/*/Spam*.mbox;
        do
            /opt/local/bin/sa-learn --spam --no-sync --mbox "$SpamBox";
            echo "Processed spam mailbox $SpamBox";
        done

for SpamBox in $maildir/Domains/*/*/Junk*.mbox;
        do
            /opt/local/bin/sa-learn --spam --no-sync --mbox "$SpamBox";
            echo "Processed spam mailbox $SpamBox";
        done

for SpamBox in $maildir/Domains/*/*/Roskaposti*.mbox;
        do
            /opt/local/bin/sa-learn --spam --no-sync --mbox "$SpamBox";
            echo "Processed spam mailbox $SpamBox";
        done

for SpamBox in $maildir/Domains/*/*/Spam*.mbox;
        do
            /opt/local/bin/sa-learn --spam --no-sync --mbox "$SpamBox";
            echo "Processed spam mailbox $SpamBox";
        done

# Centralized spam repository

for HamBox in $maildir/Accounts/spam.macnt//Ham-SpamAssassin.mbox;
        do
            /opt/local/bin/sa-learn --ham --no-sync --mbox "$HamBox";
            echo "Processed ham mailbox $HamBox";
        done

# Learn all mbox's in CGP default locations whose name matches 'Ham' as ham

for HamBox in $maildir/Accounts/*/Ham.mbox;
        do
            /opt/local/bin/sa-learn --ham --no-sync --mbox "$HamBox";
            echo "Processed ham mailbox $HamBox";
        done

for HamBox in $maildir/Domains/*/*/Ham.mbox;
        do
            /opt/local/bin/sa-learn --ham --no-sync --mbox "$HamBox";
            echo "Processed ham mailbox $HamBox";
        done


# Its faster to rebuild after all the spam/ham has been fed instead of doing
# it every time we feed a spam to spamassassin's sa-learn.

/opt/local/bin/sa-learn --sync





--
Palvelin.fi Hostmaster
postmaster@palvelin.fi

Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mensagem para o Administrador da Lista