Results 1 to 6 of 6

Thread: Zimbra and MailScanner

  1. #1
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default Zimbra and MailScanner

    Well I have started to attempt to integrate ZCS with MailScanner and so far so good ... I have installed Postfix and MS on a front-end server and have querying ZCS for valid domains, mailboxes and aliases in real time via LDAP.

    Junking emails via ZCS also updates a shared MySQL Bayes store.

    Next part is to write a LDAP hook for the Black/White listing and allow ZCS account access to MailWatch for quarantine work.

  2. #2
    blazeking is offline Advanced Member
    Join Date
    May 2008
    Location
    California!
    Posts
    226
    Rep Power
    7

    Default

    Thread subscribed. I'm curious as to how you configured MailScanner's access to the shared MySQL Bayes that Zimbra uses... or is it the other way around?

  3. #3
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    It was easy enough actually. Updated /opt/zimbra/conf/salocal.cf.in with the following
    Code:
    use_bayes 1
    bayes_auto_expire 0
    bayes_store_module              Mail::SpamAssassin::BayesStore::MySQL
    bayes_sql_dsn                   DBI:mysql:sa_bayes:xxxxxxxxxxxx
    bayes_sql_username              sa_user
    bayes_sql_password              xxxxxxxxx
    To point to the Bayes MySQL store on the MailScanner server. Same config used on the MS server aswell. That way when somebody Junk/Unjunks a email in ZCS the Bayes will be modified.

    Change the following configuration lines in /etc/MailScanner/Mailscanner.conf so that SPAM emails will appear in the Junk folder within ZCS
    Code:
    Spam Actions = deliver header "X-Spam-Flag: YES"
    Non Spam Actions = deliver header "X-Spam-Flag: NO"
    Alternatively you could update the header that ZCS uses
    Code:
    zmprov gacf zimbraSpamHeader
    zimbraSpamHeader: X-Spam-Flag
    but I am trying to keep my ZCS install as vanilla as possible.

  4. #4
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    If anybody is running ZCS V6 with the B&L lists could they try this and let me know how long it takes to run
    Code:
    #!/usr/bin/perl
    
    use Net::LDAP;
    
    my $zcs_server = 'your.zcs.server.fqdn';
    my $zmamavis_pass = 'XXXXXXXXXX';
    
    $ldap = Net::LDAP->new($zcs_server) or die "$@";
    
    @acc_filter = ( 'zimbraMailDeliveryAddress', 'zimbraMailAlias' );
    @wbl_filter = ( 'amavisWhitelistSender', 'amavisBlacklistSender' );
    
    $ldap->bind('uid=zmamavis,cn=appaccts,cn=zimbra', password => $zmamavis_pass);
    $result = $ldap->search(filter=>'(&(zimbraMailStatus=enabled))', attrs => \@acc_filter);
    
    @accounts = $result->entries;
    foreach $account (@accounts) {
            foreach $emailaccount ($account->attributes) {
                    $email = $account->get_value($emailaccount);
                    $filter = "(&(zimbraMailDeliveryAddress=" . $email . ")(zimbraMailStatus=enabled))";
                    $result = $ldap->search(filter=>$filter, attrs => \@wbl_filter);
                    @lists = $result->entries;
    
                    foreach $wbl (@wbl_filter) {
                            foreach $list (@lists) {
                                    foreach $entry ($list->get_value($wbl)) {
                                            print "$email,$wbl,$entry\n";
                                    }
                            }
                    }
            }
    }
    
    $mesg = $ldap->unbind;
    This is just a test before I write the MailScanner hook and if you can let me know how many accounts that would be great. You should see something like
    Code:
    uxbod@xxxxxxxxxxx,amavisWhitelistSender,wl1@xyz.com
    uxbod@xxxxxxxxxxx,amavisWhitelistSender,wl12@abc.com
    uxbod@xxxxxxxxxxx,amavisBlacklistSender,bl1@ghi.com
    It is not the most efficient code but it works and I already have stub code for plugging into MS as a Perl module.
    Last edited by uxbod; 08-11-2009 at 10:15 AM.

  5. #5
    uxbod's Avatar
    uxbod is offline Moderator
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    24

    Default

    Well I have created the plugin for MailScanner to query Zimbra V6 Black and White lists by LDAP. I based the code on Steve Freegards excellent SQL one. If anybody would like to try it then please PM me.

  6. #6
    leo de punk is offline Member
    Join Date
    Apr 2011
    Posts
    13
    Rep Power
    4

    Default

    Quote Originally Posted by uxbod View Post
    Well I have created the plugin for MailScanner to query Zimbra V6 Black and White lists by LDAP. I based the code on Steve Freegards excellent SQL one. If anybody would like to try it then please PM me.
    Hi UXBOD,
    I know this is a bit old thread, But I would like to know how did you query to zimbra from MailScanner. I'm trying to connect a MailScanner to my zimbra box and I am bit confused with the port setup for incoming and outgoing mails. can you please give me your instructions to connect mailscanner with zimbra in step by step as i am new to this?
    what is the better way of installing/configuring mailscanner for zimbra (in the samebox or different box)???

    many thanks in advance
    regards
    leo

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Zimbra with mailscanner
    By tharangamu in forum Administrators
    Replies: 12
    Last Post: 06-26-2012, 09:22 AM
  2. iptables & portsentry security for zimbra.
    By nishith in forum Administrators
    Replies: 1
    Last Post: 07-19-2008, 11:19 AM
  3. Zimbra Test alongside existing Imap server
    By quietas in forum Installation
    Replies: 7
    Last Post: 04-03-2008, 08:01 AM
  4. MailScanner errors after 4.5.7 upgrade
    By telv in forum Administrators
    Replies: 0
    Last Post: 09-26-2007, 04:26 PM
  5. Mailscanner
    By micke in forum Administrators
    Replies: 5
    Last Post: 08-13-2006, 10:36 AM

Posting Permissions

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