Zarafa integration with bogofilter

From Zarafa wiki

Revision as of 23:23, 23 November 2010 by Ynypokizek (Talk | contribs)
Jump to: navigation, search

Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page


How To install Bogofilter4Zarafa

<BR> <font color=red>This article is a community contribution and may include unsupported configurations. </font> <BR><BR>


A working installation of:

Zarafa Server<BR> SMTP Server with possibility to integrate bogofilter (Exim in this case)<BR> PHP 5.x incl Zarafa PHP-Mapi Module<BR> cron daemon<BR> bogofilter 1.1.x <BR> Outlook 2000-2007 Client<BR> Bogofilter Zarafa scripts<BR> <BR>


Create a public folder called bogofilter under all public folders. Install the bogofilterAdmin.oft file in this folder and set new items to be creating using this form.<BR> <BR> Create a new item in bogofilter folder. Select your Ham and NoScan folders. Every folder not set to be a Ham folder will not be scanned at all. Save the new item.<BR> <BR> Create UnsureSPAM folder in users Inbox. <BR> Copy the php file to any location at server. Set the username and password to one that has got admin right. Adapt path names if necessary.<BR> <BR> Start the script. After script run you should find the bogofilter wordlist in folder specified in php script. Open Outlook or Zarafa Web Interface and <BR> ensure that the following 3 messages exists for your username: bogofilter ham<BR> bogofilter spam<BR> bogofilter scan<BR> <BR> If everything runs feel free to set up a crontab entry.<BR> <BR>

Exim Configuration

Entry in router section:

<pre> bogofilter_router:

    domains = +local_domains
   # the next line looks for X-flag to see if the mail has been scanned
    condition = ${if !def:h_X-flag: {true }}
    driver = accept
    transport = bogofilter_filter


 driver = redirect
 file = $home/.zarafa
 directory_transport = local_delivery_zarafa
 pipe_transport = zarafa_pipe


Entry in transport section

<pre> bogofilter_filter:

   driver = pipe
   command = /usr/local/bin/exim -oMr spam-scanned -bS
   use_bsmtp = true
   # next line adds the X-flag so we will later know mail has been scanned
   headers_add =  X-flag: true
   transport_filter = "/usr/local/bin/bogofilter -d /var/lib/bogofilter -l -p -e"
   # group with enough rights
   group = bogofilter
   return_fail_output = true
   # user with enough rights
   user = bogofilter
   home_directory = "/tmp"
   log_output = true
   return_path_add = false


   driver = pipe
   # user with enough rights
   user = zarafa
   # group with enough rights
   group = zarafa
   command = "/usr/local/bin/zarafa-dagent $local_part"


   driver = appendfile
   headers_remove = X-flag
   maildir_format = true

</pre> <BR> Delivery rules in .zarafa file on per user level

<pre> if $header_X-Bogosity: contains "Yes" then

   pipe "/usr/local/bin/zarafa-dagent -j $local_part"

endif if $header_X-Bogosity: contains "Unsure" then

   pipe "/usr/local/bin/zarafa-dagent $local_part -F UnsureSPAM"

endif pipe "/usr/local/bin/zarafa-dagent $local_part" </pre> <BR> bogofilter minimum configuration

<pre> bogofilter_dir=/var/lib/bogofilter spam_header_name=X-Bogosity stats_in_header=Yes timestamp=Yes spamicity_tags = Yes, No, Unsure spamicity_formats = %0.6f, %0.6f, %0.6f charset_default=iso-8859-1 </pre>

Personal tools