+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
*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 ...
  1. #1
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29

    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

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,403
    Thank Post
    637
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    319
    For additional scripts and executable files, it's usually /usr/local/sbin or /usr/local/bin.

  3. #3
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    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?

  4. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,403
    Thank Post
    637
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    319
    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.

  5. #5


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    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.

  6. #6
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    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!

  7. #7


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by reggiep View Post
    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}

  8. Thanks to CyberNerd from:

    reggiep (5th March 2009)

  9. #8
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    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!

  10. #9


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by reggiep View Post
    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\>

  11. #10
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    Cheers Cybernerd.
    I promise that if i get it working I will try to edit it so duffers like me can understand!

  12. #11
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    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?

  13. #12


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    Quote Originally Posted by reggiep View Post
    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

  14. Thanks to CyberNerd from:

    reggiep (6th March 2009)

  15. #13
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    Quote Originally Posted by CyberNerd View Post
    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

  16. #14


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    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.

  17. Thanks to CyberNerd from:

    CarolBooth (12th October 2009)

  18. #15
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    -
    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:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 17
    Last Post: 23rd February 2009, 11:26 AM
  2. AB Control / Tutor - Word Filter
    By ninjabeaver in forum Network and Classroom Management
    Replies: 0
    Last Post: 11th February 2009, 02:42 PM
  3. Replies: 6
    Last Post: 16th February 2008, 02:28 PM
  4. Post Bad Word Filter
    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
  •