Results 1 to 6 of 6

Thread: how to build a white list?

  1. #1
    Join Date
    Feb 2008
    Location
    guangzhou,guangdong,CHINA
    Posts
    26
    Rep Power
    7

    Default how to build a white list?

    I have a email :middle6@sina.com.I use it send email to my zimbra mailbox.

    then I'll find middle6@sina.com's email go to my zimbra junk mailbox.

    As a zimbra admin, How to build a white list ?or how to copy the filter rule to everyone?

  2. #2
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    You have several options depending if you want to do it globally or individually - I'll discuss a few below:

    Global hard-lists:
    To add blackist or whitelist entries to your /opt/zimbra/conf/salocal.cf.in file, simply add lines in the following format:
    blacklist_from someone@bad.com
    whitelist_from someone@good.com
    blacklist_from *@realybad.com
    Note that * is a wildcard so in this example *@reallybad.com indicates all email from any user at reallybad.com.

    When you are finished editing the salocal.cf.in file, restart Zimbra's spamassassin by issuing the following command at the server prompt (as the zimbra user):
    zmamavisdctl restart

    Global & personal soft-lists:

    Soft lists just add or subtract values to the total score, they don't just allow or block, it's like giving certain accounts or regex's a little help towards one direction in scoring. Checkout your /opt/zimbra/conf/amavis.conf.in file, you should see a section like:
    # ENVELOPE SENDER SOFT-WHITELISTING / SOFT-BLACKLISTING

    @score_sender_maps = ({ # a by-recipient hash lookup table,
    # results from all matching recipient tables are summed

    # ## per-recipient personal tables (NOTE: positive: black, negative: white)
    # 'user1@example.com' => [{'bla-mobile.press@bad.com' => 10.0}],
    # 'user3@example.com' => [{'.good.com' => -3.0}],
    # '.angel.com' => -5.0}],

    ## site-wide opinions about senders (the '.' matches any recipient)
    '.' => [ # the _first_ matching sender determines the score boost

    new_RE( # regexp-type lookup table, just happens to be all soft-blacklist
    [qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryo u)@'i => 5.0],
    [qr'^(greatcasino|investments|lose_weight_today|mar ket\.alert)@'i=> 5.0],
    ),

    # read_hash("/var/amavis/sender_scores_sitewide"),

    { # a hash-type lookup table (associative array)
    'nobody@cert.org' => -3.0,
    'cert-advisory@us-cert.gov' => -3.0,
    'owner-alert@iss.net' => -3.0,
    'securityfocus.com' => -3.0,
    'ntbugtraq@listserv.ntbugtraq.com' => -3.0,
    'security-alerts@linuxsecurity.com' => -3.0,
    'mailman-announce-admin@python.org' => -3.0,
    'amavis-user-admin@lists.sourceforge.net'=> -3.0,
    'amavis-user-bounces@lists.sourceforge.net' => -3.0,
    'spamassassin.apache.org' => -3.0,
    'owner-postfix-announce@postfix.org' => -3.0,
    'sendmail-announce-request@lists.sendmail.org' => -3.0,
    'donotreply@sendmail.org' => -3.0,
    lc('lvs-users-admin@LinuxVirtualServer.org') => -3.0,
    lc('owner-textbreakingnews@CNNIMAIL12.CNN.COM') => -5.0,

    # soft-blacklisting (positive score)
    'sender@example.net' => 3.0,
    '.example.net' => 1.0,
    Personal hard-list:
    zmprov ma user@domain.com +amavisWhiteListSender name1@example.com +amavisWhiteListSender name2@example2.com
    To put that in the UI is: Bug 6953 - Per user spam white lists in the UI
    (opposite is amavisBlackListSender

    Personal mail-filter methods:

    1) Preferences> mailfilters > make one with the action discard or move to junk
    (the users can do this one)
    2) zmmailbox:
    addFilterRule(afrl) [opts] {name} [*active|inactive] [any|*all] {conditions}+ {actions}+
    -f/--first add as first filter rule
    -b/--before <arg> add before filter-name
    -a/--after <arg> add after filter-name
    -l/--last add as last filter rule

    deleteFilterRule(dfrl) {name}

    getFilterRules(gfrl)

    modifyFilterRule(mfrl) {name} [*active|inactive] [any|*all] {conditions}+ {actions}+

    {conditions}:
    header "name" is|not_is|contains|not_contains|matches|not_matche s "value"
    header "name" exists|not_exists
    date before|not_before|after|not_after "YYYYMMDD"
    size under|not_under|over|not_over "1|1K|1M"
    body contains|not_contains "text"
    addressbook in|not_in "header-name"
    attachment exists|not_exists

    {actions}:
    keep
    discard
    fileinto "/path"
    tag "/tag"
    mark read|flagged
    redirect "address"
    stop
    Like:
    zmmailbox -z -m user@domain.com addFilterRule "tag special" active any header "subject" contains "special" tag "special" discard
    3) zmprov:
    zmprov modifyAccount user@domain.com zimbraMailSieveScript 'require ["fileinto", "reject", "tag", "flag"]
    Note that the personal filters method would only be useful for unwanted unless you change the behavior:
    In ZCS 5.0.1 and earlier, user filters were run before the spam filter check was run. This meant that if the user filtered mail into a folder, spam would not be identified and sent to the Junk folder.
    Beginning with 5.0.2, spam check is completed first and messages identified as spam are moved to the Junk folder. With this change, users cannot write a filter to move false positive spam out of the Junk folder.

    If you prefer ZCS 5.0.2+ to use the spam filter function as it works for 5.0.1 and earlier, you can set the zimbraSpamApplyUserFilters option to True.
    This can be done by COS:
    zmprov mc COSname zimbraSpamApplyUserFilters TRUE
    or for individual accounts:
    zmprov ma user@domain.com zimbraSpamApplyUserFilters TRUE
    Last edited by mmorse; 04-14-2009 at 09:02 PM.

  3. #3
    Join Date
    Dec 2005
    Posts
    94
    Rep Power
    10

    Default This works for me

    Code:
    #!/bin/bash
    ACC=`/opt/zimbra/bin/zmprov gaa`
    for i in $ACC
    do
    /opt/zimbra/bin/zmmailbox -z -m $i gact | grep -u email: | sort | uniq | sed -e 's/email:/whitelist_from/g' >> /tmp/autowhitelistall.tmp
    done
    sed -i '/clean-wire.net/d' /tmp/autowhitelistall.tmp
    sed -i '/chromedcomputing.com/d' /tmp/autowhitelistall.tmp
    ... Repeat for each domain on the Zimbra server ...
    cat /tmp/autowhitelistall.tmp | sort | uniq > /opt/zimbra/conf/spamassassin/autowhitelistall.cf
    rm -f /tmp/autowhitelistall.tmp
    /opt/zimbra/bin/zmamavisdctl restart
    It's ugly but does the job and it's easy for end users to understand that addressbook = whitelist.

  4. #4
    Join Date
    Aug 2007
    Location
    Yorba Linda, CA
    Posts
    89
    Rep Power
    8

    Default

    Brian: does this still work? It looks like a neat solution, and I would love to be able to tell my users that they can just add someone to their address book to keep them out of the Spam folder. Also, how/how often do you run it (nightly cronjob, etc?)

  5. #5
    Join Date
    Jul 2007
    Posts
    6
    Rep Power
    8

    Default

    works for me on 5.0.10

  6. #6
    Join Date
    Aug 2007
    Location
    Yorba Linda, CA
    Posts
    89
    Rep Power
    8

    Default

    Thanks. I'll give it a try.

Similar Threads

  1. Keeping white list from Being SPAM-checked
    By tilinhonh in forum Administrators
    Replies: 0
    Last Post: 09-28-2007, 05:59 AM
  2. How to: white list all contacts
    By sturgis in forum Administrators
    Replies: 5
    Last Post: 04-14-2007, 05:45 AM
  3. white list / black list feature?
    By partypooper in forum Administrators
    Replies: 1
    Last Post: 06-16-2006, 06:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •