Zarafa integration with bogofilter

From Zarafa wiki

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ynypokizek (talk) to last revision by Admin)
 
Line 1: Line 1:
-
----
 
-
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
-
----
 
-
=[http://ocilufic.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
 
-
----
 
-
=[http://ocilufic.co.cc CLICK HERE]=
 
-
----
 
-
</div>
 
== How To install Bogofilter4Zarafa ==
== How To install Bogofilter4Zarafa ==
-
&lt;BR>
+
<BR>
-
&lt;font color=red>'''This article is a community contribution and may include unsupported configurations.''' &lt;/font>
+
<font color=red>'''This article is a community contribution and may include unsupported configurations.''' </font>
-
&lt;BR>&lt;BR>
+
<BR><BR>
'''Prerequisites'''
'''Prerequisites'''
Line 16: Line 8:
A working installation of:
A working installation of:
-
Zarafa Server&lt;BR>
+
Zarafa Server<BR>
-
SMTP Server with possibility to integrate bogofilter (Exim in this case)&lt;BR>
+
SMTP Server with possibility to integrate bogofilter (Exim in this case)<BR>
-
PHP 5.x incl Zarafa PHP-Mapi Module&lt;BR>
+
PHP 5.x incl Zarafa PHP-Mapi Module<BR>
-
cron daemon&lt;BR>
+
cron daemon<BR>
-
bogofilter 1.1.x &lt;BR>
+
bogofilter 1.1.x <BR>
-
Outlook 2000-2007 Client&lt;BR>
+
Outlook 2000-2007 Client<BR>
-
Bogofilter Zarafa scripts [[Media:Bogofilter4zarafa-1.00.zip]]&lt;BR>
+
Bogofilter Zarafa scripts [[Media:Bogofilter4zarafa-1.00.zip]]<BR>
-
&lt;BR>
+
<BR>
'''Installation'''
'''Installation'''
Line 29: Line 21:
Create a public folder called bogofilter under all public folders. Install the  
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
bogofilterAdmin.oft file in this folder and set new items to be creating using
-
this form.&lt;BR>
+
this form.<BR>
-
&lt;BR>
+
<BR>
Create a new item in bogofilter folder. Select your Ham and NoScan folders.  
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
Every folder not set to be a Ham folder will not be scanned at all. Save the
-
new item.&lt;BR>
+
new item.<BR>
-
&lt;BR>
+
<BR>
Create UnsureSPAM folder in users Inbox.
Create UnsureSPAM folder in users Inbox.
-
&lt;BR>
+
<BR>
Copy the php file to any location at server. Set the username and password to
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.&lt;BR>
+
one that has got admin right. Adapt path names if necessary.<BR>
-
&lt;BR>
+
<BR>
Start the script. After script run you should find the bogofilter wordlist in
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 &lt;BR>
+
folder specified in php script. Open Outlook or Zarafa Web Interface and <BR>
ensure that the following 3 messages exists for your username:
ensure that the following 3 messages exists for your username:
-
bogofilter ham&lt;BR>
+
bogofilter ham<BR>
-
bogofilter spam&lt;BR>
+
bogofilter spam<BR>
-
bogofilter scan&lt;BR>
+
bogofilter scan<BR>
-
&lt;BR>
+
<BR>
-
If everything runs feel free to set up a crontab entry.&lt;BR>
+
If everything runs feel free to set up a crontab entry.<BR>
-
&lt;BR>
+
<BR>
'''Exim Configuration'''
'''Exim Configuration'''
Line 54: Line 46:
Entry in router section:
Entry in router section:
-
&lt;pre>
+
<pre>
bogofilter_router:
bogofilter_router:
     domains = +local_domains
     domains = +local_domains
Line 70: Line 62:
   directory_transport = local_delivery_zarafa
   directory_transport = local_delivery_zarafa
   pipe_transport = zarafa_pipe
   pipe_transport = zarafa_pipe
-
&lt;/pre>
+
</pre>
Entry in transport section
Entry in transport section
-
&lt;pre>
+
<pre>
bogofilter_filter:
bogofilter_filter:
     driver = pipe
     driver = pipe
Line 105: Line 97:
     envelope_to_add
     envelope_to_add
     return_path_add
     return_path_add
-
&lt;/pre>
+
</pre>
-
&lt;BR>
+
<BR>
Delivery rules in .zarafa file on per user level
Delivery rules in .zarafa file on per user level
-
&lt;pre>
+
<pre>
if $header_X-Bogosity: contains "Yes" then
if $header_X-Bogosity: contains "Yes" then
     pipe "/usr/local/bin/zarafa-dagent -j $local_part"
     pipe "/usr/local/bin/zarafa-dagent -j $local_part"
Line 119: Line 111:
endif
endif
pipe "/usr/local/bin/zarafa-dagent $local_part"
pipe "/usr/local/bin/zarafa-dagent $local_part"
-
&lt;/pre>
+
</pre>
-
&lt;BR>
+
<BR>
bogofilter minimum configuration
bogofilter minimum configuration
-
&lt;pre>
+
<pre>
bogofilter_dir=/var/lib/bogofilter
bogofilter_dir=/var/lib/bogofilter
spam_header_name=X-Bogosity
spam_header_name=X-Bogosity
Line 131: Line 123:
spamicity_formats = %0.6f, %0.6f, %0.6f
spamicity_formats = %0.6f, %0.6f, %0.6f
charset_default=iso-8859-1
charset_default=iso-8859-1
-
&lt;/pre>
+
</pre>

Latest revision as of 09:11, 24 November 2010

How To install Bogofilter4Zarafa


This article is a community contribution and may include unsupported configurations.

Prerequisites

A working installation of:

Zarafa Server
SMTP Server with possibility to integrate bogofilter (Exim in this case)
PHP 5.x incl Zarafa PHP-Mapi Module
cron daemon
bogofilter 1.1.x
Outlook 2000-2007 Client
Bogofilter Zarafa scripts Media:Bogofilter4zarafa-1.00.zip

Installation

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.

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.

Create UnsureSPAM folder in users Inbox.
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.

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
ensure that the following 3 messages exists for your username: bogofilter ham
bogofilter spam
bogofilter scan

If everything runs feel free to set up a crontab entry.

Exim Configuration

Entry in router section:

bogofilter_router:
     domains = +local_domains
     no_verify
    # 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
userzarafabox:
  driver = redirect
  check_local_user
  file = $home/.zarafa
  no_verify
  allow_filter
  directory_transport = local_delivery_zarafa
  pipe_transport = zarafa_pipe

Entry in transport section

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
zarafa_pipe:	
    driver = pipe
    # user with enough rights
    user = zarafa
    # group with enough rights
    group = zarafa
    command = "/usr/local/bin/zarafa-dagent $local_part"
    return_path_add
local_delivery_zarafa:
    driver = appendfile
    headers_remove = X-flag
    maildir_format = true
    delivery_date_add
    envelope_to_add
    return_path_add


Delivery rules in .zarafa file on per user level

if $header_X-Bogosity: contains "Yes" then
    pipe "/usr/local/bin/zarafa-dagent -j $local_part"
    finish
endif
if $header_X-Bogosity: contains "Unsure" then
    pipe "/usr/local/bin/zarafa-dagent $local_part -F UnsureSPAM"
    finish
endif
pipe "/usr/local/bin/zarafa-dagent $local_part"


bogofilter minimum configuration

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
Personal tools