From: "Palvelin Postmaster" Received: from [83.150.109.27] (HELO palvelin.fi) by mail.tffenterprises.com (CommuniGate Pro SMTP 6.1.7) with ESMTPS id 19440346 for cgpsa-discuss@mail.tffenterprises.com; Tue, 29 May 2018 02:52:43 -0700 Received-SPF: pass receiver=mail.tffenterprises.com; client-ip=83.150.109.27; envelope-from=postmaster@palvelin.fi X-ClamAV-Checked: YES DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=palvelin.fi; h=from :content-type:content-transfer-encoding:mime-version:subject :date:references:to:in-reply-to:message-id; s=posti; bh=QsXi6Nq3 Vm7SZHjvG2vQg/HDGRwfPbgwDHRhLW1GzT8=; b=uQ+HVDpzxQAKCGpHNuiyIbQ1 z4aRXa5jX0DG6/Y+ryIgXJFSZMBBIPLJYGQsHa73y1TrP+0l/18JKq1202uNQfmT uZophCiTysbQzFrMSYQYyxpAJr2qMscCdhbSukAJ93TWk3BIrSdJYw6GXrGinZGE xBGNDUKT2oH/d0vVmkM= Received: from l2tp71.pixmill.fi (account postmaster@palvelin.fi [83.150.109.71] verified) by palvelin.fi (CommuniGate Pro SMTP 6.2.4) with ESMTPSA id 10161403 for cgpsa-discuss@mail.tffenterprises.com; Tue, 29 May 2018 12:52:27 +0300 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: [CGPSA] Delivering spam to Junk mailbox of each recipient Date: Tue, 29 May 2018 12:52:27 +0300 References: To: CGPSA Discussion List In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3445.6.18) > On 29 May 2018, at 10:53, Patrick Sneyers = wrote: >=20 >=20 >=20 >> Op 29 mei 2018, om 09:09 heeft Palvelin Postmaster = het volgende geschreven: >>=20 >>=20 >>> On 29 May 2018, at 9:37, Patrick Sneyers = wrote: >>>=20 >>>> Op 29 mei 2018, om 08:17 heeft Palvelin Postmaster = het volgende geschreven: >>>>=20 >>>> Hi, >>>>=20 >>>> 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=E2=80=99s bayes filter. >>>>=20 >>>> I=E2=80=99m considering changing my strategy to having a per-user = spam folder instead. I=E2=80=99m thinking this could, at the very least, = empower the users to actually receive these messages and manage possible = false positives. >>>>=20 >>>> Does anyone have any experience or insights about the strengths and = weaknesses of alternate handling strategies? >>>>=20 >>>> What would be the best way to implement this? Do I just need to = make a =E2=80=99Store In=E2=80=99 domain-wide rule for each domain = instead of the single system-wide rule I have now? >>>>=20 >>>=20 >>> You can use this option in cgpsa.conf (line 552 in my file), and = keep using the server wide rule. >>=20 >> Ahh=E2=80=A6I had forgotten about that. Thanks for the reminder! :) >>=20 >> So, here=E2=80=99s my current server-wide processing rule. Do I just = need to delete the =E2=80=99Store In=E2=80=99 action and tweak the = cgpsa.conf dma settings? >>=20 >> Subject is *SPAM-PALVELIN* >> Header Field is X-Spam-Flag: YES*=20 >>=20 >> Add Header >> X-Spam-Global: YES >> Write To Log >> Spam (GLOBAL) Detected >> Store In >> ~spam/Junk-SpamAssassin >> Discard >=20 > After setting dma in cgpsa.conf (and restarting extfilter), you can = disable that rule completely. Just keep the one above, with the = "ExternalFilter =3D cgpsa" action. =E2=80=9D=E2=80=A6the one above=E2=80=9D? >>> Of course, learning spam/ham becomes a bit more complicated then. >>=20 >> 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=E2=80=99t see a need to = make any changes to it. >=20 > Then you're all set! > Would you be willing to share that script? :) Sure, but this is very crude. :) #!/bin/bash maildir=3D"/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