*nix Thread, Zimbra bad word filter in Technical; Hey ho,
I was playing with my zimbra install last night again, I really need a hobby.
Has anyone used ...
-
5th March 2009, 10:48 AM #1 Zimbra bad word filter
Hey ho,
I was playing with my zimbra install last night again, I really need a hobby.
Has anyone used the badword filter from the wiki?
I was having a go at the word filter and Igot as far as the creating the script bit here...
We now need to create and edit the script that ties it all together, probably you can copy it from here. This script was modified from the postfix website. Check that INSPECT_DIR points to your filter directory, SENDMAIL points to your putmail.py program, BADWORDS points to the location of your words file and that MAILADMIN is set to the email address of the administrator.
I can't find where I need to save this, am i missing something or can I just save it anywhere?
Thanks
-
-
IDG Tech News
-
5th March 2009, 11:00 AM #2 For additional scripts and executable files, it's usually /usr/local/sbin or /usr/local/bin.
-
-
5th March 2009, 11:50 AM #3 Thanks webman or should I call you grasshopper 
Has anyone else used this filter in there zimbra install?
I have completed all the instructions but not sure what to do now.
Wondering if the script needs to be run from cron?
-
-
5th March 2009, 12:18 PM #4 Once you have modified the postfix files, the script should run when any message is sent/received - no need to schedule it or anything like that.
-
-
5th March 2009, 12:20 PM #5 I'm using it.
The script doesn't need to be run from cron - it should be called from postfix.
There is a /opt/zimbra/postfix/master.cf (or master.cf.in if it exists) file that needs to be edited. (backup this file first)
The idea is that the email gets passed out of the postfix process by the master.cf configuration. the email is then filtered and dropped back into postfix by putmail if it passes the badword filter and dropped if it doesn't.
-
-
5th March 2009, 12:26 PM #6 I must have missed something then as I can't see anywhere that references my script!
I created the script but saved it with a name of filterwords.sh as in the section of the wiki that starts...
Code:
We now need to create and edit the script that ties it all together, probably you can copy it from here. This script was modified from the postfix website. Check that INSPECT_DIR points to your filter directory, SENDMAIL points to your putmail.py program, BADWORDS points to the location of your words file and that MAILADMIN is set to the email address of the administrator.
!/bin/sh
# Simple shell-based filter. It is meant to be invoked as follows:
# /path/to/script -f sender recipients...
# Localize these. The -G option does nothing before Postfix 2.3.
As it doesn't tell me where to save it and what as, I called it filterwords.sh and saved it it /usr/local/bin.
I'm assuming Iv'e messed up again somewhere!
-
-
5th March 2009, 12:55 PM #7 
Originally Posted by
reggiep
I must have missed something then as I can't see anywhere that references my script!
the master.cf file should reference it
Code:
disclaimer unix - n n - - pipe
flags=Rq user=zimbra argv=/usr/local/sbin/filter -f ${sender} -- ${recipient}
-
Thanks to CyberNerd from:
-
5th March 2009, 01:06 PM #8 Thanks for that cybernerd. It did sort of say to do that in the wiki but it was a bit vague.
Now I have your attention you couldn't let me know how the heck the badword list works could you?
The example is...
\<badword\>
\<badword1\>
\<badword1
\<badword2\>
\<badword2
You couldn't show me how that should look with a couple of words in it could you?
I can't see the logic in it at the moment!
-
-
5th March 2009, 01:08 PM #9 
Originally Posted by
reggiep
Thanks for that cybernerd. It did sort of say to do that in the wiki but it was a bit vague.
It's a wiki, so it's waiting for you to update it 
Code:
\<sh*te\>
\<sh*tter\>
\<tw*t\>
-
-
5th March 2009, 01:10 PM #10 Cheers Cybernerd.
I promise that if i get it working I will try to edit it so duffers like me can understand!
-
-
5th March 2009, 03:11 PM #11 I'm sure I'm getting closer to getting this to work now!
When i send an email out at the moment it gets returned with an error...
Code:
Command died with status 1: "/usr/local/sbin/filter".
Command output: Error: HOME environment variable not set
I can get rid of this error by returning to my original master.cf so I'm not overly worried but it does mean I'm not getting my words filtered!
Just wondering if it means HOME not set in the filter file or in the master.cf?
-
-
5th March 2009, 04:06 PM #12 
Originally Posted by
reggiep
I'm sure I'm getting closer to getting this to work now!
When i send an email out at the moment it gets returned with an error...
Code:
Command died with status 1: "/usr/local/sbin/filter".
Command output: Error: HOME environment variable not set
I can get rid of this error by returning to my original master.cf so I'm not overly worried but it does mean I'm not getting my words filtered!
Just wondering if it means HOME not set in the filter file or in the master.cf?
I think it may be referring to the putmail.py configuration file.
I have a file called /opt/zimbra/.putmail/putmailrc (the location is defined in the putmail.py script ) it determines where the email ends up if it matches a filter
Code:
[config]
server = localhost
email = BOFH@school.sch.uk
port = 10026
also check perms on that file
-
Thanks to CyberNerd from:
-
6th March 2009, 09:16 AM #13 
Originally Posted by
CyberNerd
I
think it may be referring to the putmail.py configuration file.
I have a file called /opt/zimbra/.putmail/putmailrc (the location is defined in the putmail.py script ) it determines where the email ends up if it matches a filter
Code:
[config]
server = localhost
email = BOFH@school.sch.uk
port = 10026
also check perms on that file
I have checked that file and I do have it set up with my settings just like yours.
Could you help with how I check the permissions?
Is that with chmod ?
Thanks
-
-
6th March 2009, 09:19 AM #14
ls -l /opt/zimbra/.putmail/
total 8
-rw-r--r-- 1 zimbra zimbra 183 Feb 6 2007 putmail.log
-rw-r--r-- 1 zimbra zimbra 77 Jun 15 2006 putmailrc
Code:
chown zimbra:zimbra /opt/zimbra/.putmail -R
check that the putmail.py script has all the variables set correctly.
-
Thanks to CyberNerd from:
CarolBooth (12th October 2009)
-
6th March 2009, 10:02 AM #15 - Code:
rw-r--r-- 1 zimbra zimbra 77 Jun 15 2006 putmailrc
Mine had
Code:
-rw-r--r-- 1 root root 77 Jun 15 2006 putmailrc
so I used chown and now it looks like yours.
Cheers I'll let you know how this fairs.
-
SHARE: 
Similar Threads
-
Replies: 17
Last Post: 23rd February 2009, 11:26 AM
-
By ninjabeaver in forum Network and Classroom Management
Replies: 0
Last Post: 11th February 2009, 02:42 PM
-
By CyberNerd in forum *nix
Replies: 6
Last Post: 16th February 2008, 02:28 PM
-
By crc-ict in forum Comments and Suggestions
Replies: 2
Last Post: 18th October 2006, 02:49 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules