Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Other > /etc

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-03-2009, 08:11 AM
Moderator
 
Posts: 7,928
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.
__________________
Reply With Quote
  #2 (permalink)  
Old 08-06-2009, 10:56 AM
Advanced Member
 
Posts: 204
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?
Reply With Quote
  #3 (permalink)  
Old 08-06-2009, 11:33 PM
Moderator
 
Posts: 7,928
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.
__________________
Reply With Quote
  #4 (permalink)  
Old 08-11-2009, 10:13 AM
Moderator
 
Posts: 7,928
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..
Reply With Quote
  #5 (permalink)  
Old 08-11-2009, 11:31 PM
Moderator
 
Posts: 7,928
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.
__________________
Reply With Quote
  #6 (permalink)  
Old 04-26-2011, 10:51 PM
Member
 
Posts: 13
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.