Changes

From SME Server
Jump to navigationJump to search
5,280 bytes added ,  00:16, 24 November 2020
no edit summary
Line 1: Line 1: −
[[Category:Mail]][[Category:Contrib]]
+
==Maintainer==
 +
This contrib has been developed by [[User:Knuddi|Jesper Knudsen]] from [http://smeoptimizer.swerts-knudsen.dk SME Optimizer]
 +
 
 +
We have now added it to the contribs repo and are updating it for v10.
 +
 
 +
It needs the smeserver-dovecot-extras rpm
 +
 
 +
https://wiki.contribs.org/Dovecot-extras
 +
 
 +
 
 +
{{ #smeversion: smeserver-unjunkmgr }}
 +
 
 +
(currently in smedev)
 +
 
 
==Description==
 
==Description==
 
I have for a long time had ”customers” that POP’ed emails from my servers and that therefore did not have a good chance to see and/or retrieve emails that had been sorted to the junkmail folder by SpamAssassin. The same actually goes for IMAP users that often ''forgot'' to look the junkmail folder when they thought emails were missing.
 
I have for a long time had ”customers” that POP’ed emails from my servers and that therefore did not have a good chance to see and/or retrieve emails that had been sorted to the junkmail folder by SpamAssassin. The same actually goes for IMAP users that often ''forgot'' to look the junkmail folder when they thought emails were missing.
Line 13: Line 26:  
==Installation==
 
==Installation==
   −
The package needs the Perl-MIME-Lite package to be able to send out HTML formatted emails and MRTG to create the statistics graphs.
+
You can install this contribs by yum with the following command. You should use this method as you will have always the newest version.
 +
yum install --enablerepo=smecontribs smeserver-unjunkmgr
   −
yum install perl-MIME-Lite --enablerepo=smecontribs
+
for SME10 you need the epel repository:
yum install mrtg --enablerepo=base
  −
{{Note box|Make sure you have the [base] repository enabled for yum or it cannot find the MRTG package!}}
     −
Then install the sme-unjunkmgr RPM from (I will get around and release to contribs later):
+
yum install --enablerepo=smecontribs,epel smeserver-unjunkmgr
   −
  rpm –Uvh http://sme.swerts-knudsen.com/downloads/unjunkmgr/sme-unjunkmgr-1.0.1-1.noarch.rpm
+
and then
 +
  expand-template /etc/crontab
 +
expand-template /etc/httpd/conf/httpd.conf
 +
/etc/rc.d/init.d/httpd-e-smith restart
   −
====De-installation or de-activation====
+
or
You can simply remote the package again with the usual rpm command - make sure to expand templates (until I get it into RPM)
+
signal-event post-upgrade; signal-event reboot
   −
  rpm –e sme-unjunkmgr-1.0.0-1
+
====Upgrading====
 +
 
 +
  yum upgrade --enablerepo=smecontribs smeserver-unjunkmgr
 +
====Uninstall====
 +
You can simply remove the package again with the usual yum command.
 +
 
 +
  yum remove smeserver-unjunkmgr
 +
 
 +
NOTE: If you are uninstalling version '''1.0.0-1''' you also need to also expand templates.
 
  expand-template /etc/crontab
 
  expand-template /etc/crontab
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  /etc/rc.d/init.d/httpd-e-smith restart
 
  /etc/rc.d/init.d/httpd-e-smith restart
   −
or disable the functionality with:
+
==Configuration==
 +
 
 +
====Email Notifications====
 +
The UnJunk Manager sends out the summary email every Friday at 1PM to all users with emails stored in their junkmail folder. If you wish the admin account to get copied on all these user emails then this can be enabled/disabled with (default: no):
 +
 
 +
/sbin/e-smith/db configuration setprop unjunkmgr adminemails <no|yes>
 +
 
 +
If you just want to use the UnJunk Manager to gather statistics and not send out any summary emails to the users you can disable this functionality with (default: yes):
 +
 
 +
/sbin/e-smith/db configuration setprop unjunkmgr useremails <no|yes>
 +
 
 +
How do I configure the UnJunkMgr to use an IP address or a different hostname rather than the primary domain name when it sends out the weekly overview (default: domainname)?
 +
 
 +
/sbin/e-smith/db configuration setprop unjunkmgr unjunkhost <hostname|IP address>
 +
 
 +
The summary emails contain a link to an web page where emails can be unjunked (released to he inbox). These URLs cann, by default, only be seen from the local network (IP ranges defined in Local Network in the server-manager) but if you want this to be accessible from remote networks (public access) this can be done via (default: yes):
 +
 
 +
/sbin/e-smith/db configuration setprop unjunkmgr LocalOnly <no|yes>
 +
expand-template /etc/httpd/conf/httpd.conf
 +
/etc/rc.d/init.d/httpd-e-smith restart
 +
 
 +
====Statistics====
   −
/sbin/e-smith/db configuration set unjunkmgr service enabled <no|yes>
+
The UnJunk Manager also collects statistics on the emails passing through the mail server. This is accessible from:
   −
==Configuration==
+
http://your.domain.com/unjunkmgr
 +
 
 +
This web page and the unjunk functionality as described above can, by default, only be seen from the local network (IP ranges defined in Local Network in the server-manager) but if you want this to be accessible from remote networks (public access) this can be done via (default: yes):
 +
 
 +
/sbin/e-smith/db configuration setprop unjunkmgr LocalOnly <no|yes>
 +
expand-template /etc/httpd/conf/httpd.conf
 +
/etc/rc.d/init.d/httpd-e-smith restart
 +
 
 +
[[Image:Unjunkwebstat.jpg]]
 +
 
 +
An additional feature of the UnJunk Manager is to send the collected statistics to a central statistics central at http://central.swerts-knudsen.dk. The gathering of data is not stressful for the server and the data sent is not sensitive (well in my opinion) and consists of:
 +
 
 +
* Amount of emails scanned
 +
* Number of spam infected (tagged and rejected) or virus infected emails (if virus found the ClamAV name)
 +
* The version of SME server used
 +
* Public IP address of server (used to plot in Google Maps on central.swerts-knudsen.com)
 +
 
 +
Should you want to disable this functionality then this can obviously be done:
 +
 
 +
/sbin/e-smith/db configuration setprop unjunkmgr statsclient <disabled|enabled>
 +
 
 +
====SpamAssassin bayes filters====
   −
The SpamAssassin learning does require that the SpamAssassin bayes filters have been enabled though. How this is done can be read at http://wiki.contribs.org/Email#Setup_Blacklists_.26_Bayesian_Autolearning or through these few shell commands.
+
The SpamAssassin learning requires that the SpamAssassin bayes filters have been enabled though. How this is done can be read at http://wiki.contribs.org/Email#Setup_Blacklists_.26_Bayesian_Autolearning or through these few shell commands.
    
  config setprop spamassassin UseBayes 1
 
  config setprop spamassassin UseBayes 1
Line 56: Line 121:  
  signal-event email-update  
 
  signal-event email-update  
    +
====Unofficial ClamAV signatures====
 +
I would also recommend to install the script that downloads all the unofficial ClamAV signatures as these detects not only virus but equally importantly various kinds of malware and spam.
   −
The UnJunk Manager also collects statistics on the emails passing through the mail server. This is accessible from:
+
Follow the guide for [[Virus:Additional_Signatures|Additional Virus Signatures]] to do that.
   −
http://your.domain.com/unjunkmgr
+
==FAQ==
   −
This web page and the unjunk functionality can, by default, only be seen from the local network (IP ranges defined in Local Network in the server-manager) but if you want this to be accessible from remote networks (public access) this can be done via:
+
===How do I see what this Summary of Junkmail looks like without sending to all my users?===
 +
You will need to change config via:
 +
/sbin/e-smith/db configuration setprop unjunkmgr useremails no
 +
/sbin/e-smith/db configuration setprop unjunkmgr adminemails yes
   −
  /sbin/e-smith/db configuration setprop unjunkmgr LocalOnly <no|yes>
+
  Then launch the reminder manually with:
  expand-template /etc/httpd/conf/httpd.conf
+
  /usr/local/unjunkmgr/spamreminder.pl
/etc/rc.d/init.d/httpd-e-smith restart
     −
[[Image:Unjunkweb.jpg]]
+
All the summary emails will now be sent to “admin”.
   −
An additional feature of the UnJunk Manager is to send the collected statistics to a central statistics central at http://central.swerts-knudsen.dk. The gathering of data is not stressful for the server and the data sent is not sensitive (well in my opinion) and consists of:
+
===How do I change when the reminder email is sent out?===
-  amount of emails scanned
+
Currently this requires a manual change. Open in you preferred editor:
-  number of spam infected or virus infected emails
  −
-  if virus infected the name of the virus found
  −
-  the version of SME server used
     −
Should you want to disable this functionality then this can obviously be done:
+
/etc/e-smith/templates-custom/etc/crontab/unjunk
 +
 +
Add extra lines to have reminder sent out more often or change the hour/day in the last line with the $OUT - Change the "5" to "1" for Monday rather than Friday.
   −
  /sbin/e-smith/db configuration setprop unjunkmgr statsclient <disabled|enabled>
+
  {
 +
    use esmith::ConfigDB;
 +
 +
        my $dbh = esmith::ConfigDB->open() || die "Unable to open configuration dbase.";
 +
        my %sa_conf = $dbh->get('unjunkmgr')->props;
 +
 +
        while (my ($parameter,$value) = each(%sa_conf)) {
 +
          if ($parameter eq 'enabled') {
 +
          $enabled = $value;
 +
          }
 +
        }
 +
 +
        $OUT = "";
 +
        if (uc($enabled) eq 'YES') {
 +
        $OUT .= "# Schedule the UnJunk every 5 minutes\n";
 +
        $OUT .= "0-59/5 * * * * root /usr/local/unjunkmgr/spamchanger.pl -file=/tmp/unjunk.file\n";
 +
        $OUT .= "\n";
 +
        $OUT .= "# Schedule the weekly Blocked Junk Summary to arrive at 1PM Friday\n";
 +
        $OUT .= "0 13 * * 5 root /usr/local/unjunkmgr/spamreminder.pl\n"; # Friday
 +
        }
 +
}
   −
Today around ~850 servers still active with my sme-spamfilter contrib and ~450 servers using my sme-antivirus for SME 6x send in data for this “worldwide overview”.
+
See the following schema for modifying the job scheduling:
   −
[[Image:Centralweb.jpg]]
+
*    *    *    *    *  command to be executed
 +
 +
|    |    |    |    |
 +
|    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 +
|    |    |    +------- month (1 - 12)
 +
|    |    +--------- day of month (1 - 31)
 +
|    +----------- hour (0 - 23)
 +
+------------- min (0 - 59)
   −
==FAQ==
+
For example, the original entry:
 
+
===How do I see what this Summary of Junkmail looks like without sending to all my users?===
+
$OUT .= "0 13 * * 5 root /usr/local/unjunkmgr/spamreminder.pl\n"; # Friday
You will need to change the “$debug = 0;” to “$debug = 1;” in the configuration section of the /usr/local/unjunkmgr/spamreminder.pl file. Then launch the reminder manually with:  
+
  /usr/local/unjunkmgr/spamreminder.pl
+
is set to run at 13:00 (1pm) on Friday of every week, to change it to say run at 4:30pm Monday to Friday:
All the summary emails will now be sent to “admin”.
+
   
 +
$OUT .= "30 16 * * 1-5 root /usr/local/unjunkmgr/spamreminder.pl\n"; # Monday to Friday
 +
 +
To see more detail on crontab scheduling see [http://www.adminschoice.com/docs/crontab.htm]
 +
 +
Then expand templates
 +
 +
expand-template /etc/crontab
    
===How do I report a problem or a suggestion?===
 
===How do I report a problem or a suggestion?===
Line 107: Line 209:     
Improved uninstall to clean up properly  
 
Improved uninstall to clean up properly  
 +
|- style="background-color:#FFFFFF"
 +
|1.1.0-1
 +
|Updated statistics overview to use pie charts for spam and different tables for virus found
 +
 +
Added new configuration parameters for most commonly asked changes to avoid hard-coding
 +
 +
Improved log file checks to avoid catching errors and warnings from ClamAV
 +
 +
Generally improved code to remove warnings to admin when sending weekly summary emails
 +
|- style="background-color:#FFFFFF"
 +
|1.1.1-1
 +
|Fixed problem with weekly emails (error line 112 in spamreminder.pl)
 +
 +
Fixed problem in post-upgrade script that caused upgrades from earlier versions to fail
 +
 +
|- style="background-color:#FFFFFF"
 +
|1.1.3-1
 +
|Now also counting rejected emails that never reaches SpamAssassin (rejected due to missing mailbox, reverse DNS fails, etc.)
 +
 +
Fixed problem using unjunkhost configuration parameter
 +
 +
Updated style sheets (CSS) to show nicely also using IE
 +
 +
Added statistic for top spammed email accounts
 +
 
|}
 
|}
 +
 +
=== Bugs ===
 +
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
 +
Use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-unjunkmgr|title=this link}}.
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id|order=desc |component=smeserver-unjunkmgr|noresultsmessage="No open bugs found."}}
 +
 +
----
 +
[[Category:Mail]]
 +
[[Category:Contrib]]
 +
[[Category:Administration:Content Spam Virus Blocking]]
 +
[[Category:Administration:Monitoring]]

Navigation menu