ispman/lib mailbox_actions_cyrus.lib,1.2.2.6,1.2.2.7

Pedro Algarvio <[email protected]> Sat, 07 Oct 2006 21:01:09 +0000
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14681/lib

Modified Files:
      Tag: dev_1_3-cyrus_virtdomain2
	mailbox_actions_cyrus.lib 
Log Message:
Removed email2uid helper function, it's no longer needed since the correct mailbox naming is fetched on the 'mailbox_action_cyrus.lib'. Cleaned the code a bit.


Index: mailbox_actions_cyrus.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/mailbox_actions_cyrus.lib,v
retrieving revision 1.2.2.6
retrieving revision 1.2.2.7
diff -u -d -r1.2.2.6 -r1.2.2.7
--- mailbox_actions_cyrus.lib	5 Oct 2006 14:18:32 -0000	1.2.2.6
+++ mailbox_actions_cyrus.lib	7 Oct 2006 21:01:07 -0000	1.2.2.7
@@ -5,6 +5,8 @@
 my $allowFullEmailLogins = 0;
 my $cyrusUnixHierarchySep = 0;
 
+# Define a TRUE/FALSE value to decrease the LDAP calls and
+# to make logic easier
 if ( lc( $ispman->getConf("allowFullEmailLogins") ) eq 'yes' ) {
     $allowFullEmailLogins = 1;
 }
@@ -14,36 +16,14 @@
 }
     
 
-# helper function to convert email into uid notation
-sub email2uid {
-    my $str = shift;
-    ( $uid, $domain ) = split( '@', $str );
-    if ( $allowFullEmailLogins ) {
-        if ( $cyrusUnixHierarchySep ) {
-            if ($uid) {
-                $uid =~s/\./\\./g;
-            }
-        }
-        if ($domain) {
-            $domain =~ s/\./\\./g;
-            $str = join '\@', ( $uid, $domain );
-        }
-    } else {
-        if ($domain) {
-            $domain =~ s/\./_/g;
-            $str = join '_', ( $uid, $domain );
-        }
-    }
-    return $str;
-}
-
+# Helper funtion that get's the correct mailbox name from the user's UID
 sub get_correct_mailbox {
-    my $mbox = shift;
+    my $_uid = shift;
     if ( $allowFullEmailLogins ) {
-        $tmbox = $ispman->getUserInfo($mbox);
+        $t_uid = $ispman->getUserInfo($_uid);
         return $tmbox->{'mailLocalAddress'};
     }
-    return $mbox;
+    return $_uid;
 }
 
 # imap connection handle
@@ -53,10 +33,8 @@
 my $sep = '.';
 if ( $cyrusUnixHierarchySep ) {
     $sep = '/';
-    $imap_mailbox_prefix .= $sep;
-} else {
-    $imap_mailbox_prefix .= $sep;
 }
+$imap_mailbox_prefix .= $sep;
 
 sub _connect {
     my $server = shift;


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV