APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

A Perl script for Kerio Connect user's settings.cfg changes


2012/07/31

One of the things Kerio Connect Webmail users can do is automatically add addresses to their personal whitelist when they reply to email. This is in the "Spam" tab of their Settings tool; do understand that this only works from Webmail - if you reply from Outlook or whatever else, this whitelist is not affected.

By the way, SOME webmail settings do have effects outside of Webmail. It's a bit confusing, as this reply from Kerio support admits. I really think they need a Knowledgebase article detailing all this:

In general, there are two types of settings which are available in
Webmail. The first group of settings affects the Webmail only. The
second group of settings affects the Kerio Connect as a server,
so they affects all clients. The spam filter settings affect the
server, because spam filtering is done by the server. But the
"automatically created list of trustworthy senders" is created
by Webmail, because such list created by an email client which
sends messages. On the other hand, you can also trust to contacts
in your Contacts folder and Kerio Outlook Connector allows you to
add/remove addresses to/from the folder. But automatically created
contacts are stored in the special folder created by MS Outlook. So,
some settings can really be little bit confusing.
 

That means that the server WILL look at the personal whitelist no matter what client you use, but addresses will only be added automatically when you use Webmail.

So, with all that in mind, what if you do NOT want your users setting this? I first thought that I'd be able to find this in the Connect API, but it's not there yet. I asked about that and got this reply:

Unfortunately there is no API for this. I've created a request for
it and we are tracking it as a bug 74373. Please note we do not
have a time frame on if or when a bugfix may be available.
 

So, I wrote a simple Perl script to make this change. You could easily modify it for any desired change, but (unfortunately) in my testing I found that a server restart is required - apparently the webmail client caches this information and even logging out didn't help (it may have if I had been more patient, of course). Here's the script; the usual warnings to read it, understand it, and test thoroughly before deploying of course apply.

#!/usr/bin/perl
$STORE="/opt/kerio/mailserver/store/mail/YOURDOMAIN.com";
chdir($STORE) or die "No $store!\n";
opendir(DIR,".") or die "Can't open $store";
while (defined($file=readdir(DIR))) {
  if (open(SETTINGS, "$file/settings.cfg" )) {
  @stuff=<SETTINGS>; close SETTINGS;
  open(ORIG,">$file/settings.ORIG");
  open(SETTINGS,">$file/settings.cfg");
  foreach (@stuff) {
      print ORIG;;
      s/"mailReplyToWhitelist" type="boolean">true/"mailReplyToWhitelist" type="boolean">false/;
      print SETTINGS;

    }
   
  }
}
 


Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> A Perl script for Kerio Connect user's settings.cfg changes




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence



Kerio Connect Mailserver

Kerio Samepage

Kerio Control Firewall

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





By understanding a machine-oriented language, the programmer will tend to use a much more efficient method; it is much closer to reality. (Donald Knuth)

What do such machines really do? They increase the number of things we can do without thinking. Things we do without thinking — there's the real danger. (Frank Herbert)












This post tagged: