Index: pontomail.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/pontomail/pontomail.module,v
retrieving revision 1.31
diff -u -r1.31 pontomail.module
--- pontomail.module	5 Oct 2006 08:59:41 -0000	1.31
+++ pontomail.module	5 Oct 2006 12:29:09 -0000
@@ -64,8 +64,11 @@
     }
 
 
+    // Show accounts only when main menu is enabled
+    $row = db_fetch_object(db_query("SELECT * FROM {menu} WHERE path = 'pontomail'"));
+
     // Grap the list of accounts
-    if((arg(1) == 'viewmailbox' || arg(0) == 'pontomail') && $access_mailbox) {
+    if((arg(1) == 'viewmailbox' || arg(0) == 'pontomail') && $access_mailbox && $row->type & MENU_VISIBLE_IN_TREE) {
       if(variable_get('pontomail_use_predefined_server', '') && !$_SESSION['mail_auth_session']['error']) {
         // List Subscribed Mail Boxes for this Account
         $imap = _pontomail_get_imap_obj('-1', "*", FALSE); // Set the redirect to false 
