Learn

From SME Server
Jump to navigation Jump to search



Maintainer

JP Pialasse

Initial contributors

Jooris Emmanuel for Firewall-services, Daniel B. from Firewall Services, Brian Read , Tim Litwiller , Michael McCarn and Jesper Knudsen


Description

Scripts (based on LearnAsSpam) which allows users to interact with spamassassin rules simply by dropping mail in special folders of their mailbox (working only with imap).

  • Learn mail as spam
  • Learn mail as ham
  • Whitelist the sender so his mails won't be tagged as spam again


Installation

yum --enablerepo=smedev,smecontribs,smetest install smeserver-learn

enable Bayes

db configuration setprop spamassassin UseBayes 1
signal-event email-update

Don't forget to configure db key according to your needs and expand config file.

Documentation

smeserver-learn store all key who need in configuration db : (the > indicate that is a prop and not a key)

LearnAsSpam Config key for the spam learning part.
>status={enabled,disabled} Enable or not spam learning. Default is disabled.
>tag=$string Tag to place before subject to warn user of his message as been learn. Default is [SPAM].
>dir=$string Name of folders where searching spam. Default is LearnAsSpam.
>SpamLinks=$string Allows to create IMAP fakedfolder linked to junkmail folder. Useful for IOS client thant keep using junk folder and do not allow to set another folder. Multiple Links could be entered separated by comas ",". Default is empty () for disabled.
>DeleteAfterLearn={enabled,disabled} delete message after learn instead of moving it back to the user's junkmail folder. Default is disabled.
>DelayToMove=$integer Get the content of the user's junkmail folder before it is deleted. Useful to get SPAM placed here by the mail client software, not yet learnt. Can only be activated if DeleteAfterLearnis enabled to avoid loop. Default 0 for disabled.
>LearnNew={enabled,disabled} Learn content of subdir of the read IMAP folder "cur"(disabled) only or also "new" (enabled- where emails are stored before any client connect to download them). Default is disabled.
>Uniq={enabled,disabled} If enabled, it will search the only corresponding folder named after "dir" property. If it does not exist it will create it. If disabled it will not create any IMAP folder, but will search for all folder containing the content of "dir" property (i.e. *dir* like mon_dir, dir3, mondir34) . Default is enabled.
LearnAsHam Config key for the ham learning part.
>status={enabled,disabled} Enable or not ham learning. Default is disabled.
>tag=$string Tag to place before subject to warn user of his message as been learn. Default is [HAM].
>dir=$string Name of folders where searching ham. Default is LearnAsHam.
>LearnNew={enabled,disabled} Learn content of subdir of the read IMAP folder "cur"(disabled) only or also "new" (enabled- where emails are stored before any client connect to download them) . Default is disabled. Not useful here.
>RemoveSPAMTag={enabled,disabled} Remove bad [SPAM] tag from subject after learning and before putting the copy of cleaned the message back in your INBOX. Default is enabled.
>Uniq={enabled,disabled} If enabled, it will search the only corresponding folder named after "dir" property. If it does not exist it will create it. If disabled it will not create any IMAP folder, but will search for all folder containing the content of "dir" property (i.e. *dir* like mon_dir, dir3, mondir34) . Default is enabled.
LearnInWL Config key for the spam of messages' senders in the whitelist learning part.
>status={enabled,disabled} Enable or not learning of messages' senders in the whitelist. Default is disabled.
>tag=$string Tag to place before subject to warn user of his message as been learn. Default is [WL].
>dir=$string Name of folders where searching message to learn in whitelist the sender address. Default is LearnInWL.
>LearnNew={enabled,disabled} Learn content of subdir of the read IMAP folder "cur"(disabled) only or also "new" (enabled- where emails are stored before any client connect to download them) . Default is disabled. Not useful.
>RemoveSPAMTag={enabled,disabled} Remove bad [SPAM] tag from subject after learning and before putting the copy of cleaned the message back in your INBOX. Default is enabled.
>Uniq={enabled,disabled} If enabled, it will search the only corresponding folder named after "dir" property. If it does not exist it will create it. If disabled it will not create any IMAP folder, but will search for all folder containing the content of "dir" property (i.e. *dir* like mon_dir, dir3, mondir34) . Default is enabled.
Learn Config key witch affect script generally
>cron={none,hourly,daily,weekly,monthly} do the search never, hourly, daily, weekly or monthlSpamLinksy. Default is daily.

E.g.:

 config setprop LearnAsSpam status enabled
 config setprop LearnInWL status enabled

Individual configuration is also possible for users with the SpamLinks property

db accounts set MYUSER SpamLinks junks,junker

One config file is modified : /etc/cron.d/Learn who need to be expand if prop Learn>cron is modified with the following.

signal-event email-update

Setup Bayesian Autolearning

You'll also have to setup Bayesian Autolearning as described in the Email page.

Automatic creation of folders

this is not necessary anymore, if you keep the Uniq property enabled. For reference, the script previously here is kept in discussion.

Uninstall

Simply do :

yum remove smeserver-learn

Bugs

Please raise bugs under the SME-Contribs section in bugzilla and select the smeserver-learn component or use this link .

IDProductVersionStatusSummary (3 tasks)
11831SME Contribs10.0UNCONFIRMEDlearn.pl attempts but fails to create default directories for some users.
9387SME Contribs8.2CONFIRMEDNFR: add script to report reported ham and spam, seen junks and not yet seen junk
9110SME Contribs9.2CONFIRMEDNFR: rbl-recheck.sh - a script to find recent emails from servers now listed in RBL