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

Group Voicemail in Kerio Operator


2013/02/20

I hope this article becomes irrelevant in some future version of Kerio Operator.

Right now, if you want to deliver voicemail to a group of people, you can't do that with the Connect/Operator Integration method. The reason is that Kerio doesn't use SMTP to get the message to you in Connect - I'm still not entirely clear on the details, but apparently they use IMAP to insert the messages and the result is that you need to use a Connect account that can authenticate (no groups, mailing lists or aliases) and no forwarding associated with that account will be done.

There are advantages to that.  If this is set and you mark a message as read in Kerio MyPhone or if the message is marked as read after you hear it on your phone, the message will also be flagged as read in your mailbox (and vice versa).   

On the other hand, group voicemail is also desirable - for example, a "general" voicemail mailbox that might collect messages outside of business hours.

So, how to have both?  I think Kerio could do this easily enough with a fallback to attempt SMTP delivery if they can't authenticate.  You could then use a "[email protected]" that was a group - the IMAP authentication would fail, so they could fall back to try SMTP.  However, that's NOT how it works now, so I wrote a little script.

This assumes a "general" Connect user with a password and a "general_vm" group, mailing list or alias (see Using Kerio public folders in place of mail groups for an example of why you might want to  use an alias instead of a group).  

The example script is in Perl for Linux and needs to run with root perms as written.  Obvious adjustments will be needed for Windows and Mac systems:

#!/usr/bin/perl
# Forward Operator pulled mail to a group account
# Run this from crontab with something like
#     */10 * * * * /root/bin/operator_kludge.pl 
# This dual approach (crontab and a loop in the script) has two
# advantages: one, it lets me easily adjust the resolution of the
# checks to a smaller or larger time easily and it also helps guard
# against the script accidentally getting killed - crontab will
# restart it within ten minutes.


# change this for proper path
#
chdir("/opt/kerio/mailserver/store/mail/yourdomain.com/general/INBOX/#msgs") 
   or die "No /opt/kerio/mailserver/store/mail/yourdomain.com/general/INBOX/#msgs";

for ($x=0;$x<10;$x++) {
  open(LAST, "/root/data/vm_lastseen");
  $last = <LAST>;
  foreach (<*>) { 
    #print "$_ ";
    @s=stat($_);
    # $s[9] is mtime
    if ($s[9] > $last) {
      $eml=$_;
      $last=$s[9];
      open(EML,"<:crlf", $_);
    
#print "Sending..\n";
open(O, ">/root/data/tfile");
$from="";
while (<EML>) {
 $from=1 if /^From:/;
 next if not $from;
 s/To:.*/To: general_vm\@yourdomain.com/;
 print O $_;
}
close O;
close EML;
system("/opt/kerio/mailserver/sendmail < /root/data/tfile");

}

}
  open(LAST, ">/root/data/vm_lastseen");
  print LAST $last;
  close LAST;
  sleep 60;
}
 

You'll need to clear out the "general" INBOX from time to time.   You could set that in "Item Cleanout" for the "general" user instead of doing it manually.

Connect/Operator Integration

Using IMAP to insert the messages



Got something to add? Send me email.





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

Printer Friendly Version

-> -> Group Voicemail in Kerio Operator




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





Solving today's problems with yesterday's technology,someday (Kevin Brooks Clark)

Thunder is good, thunder is impressive; but it is lightning that does the work. (Mark Twain)












This post tagged: