How to use Webmail plus module?

pankajshr_jpr - April 9, 2009 - 14:26

I want to use the webmail module for my website but i cant able to configure my mail server with it. My domain is visvas.org. It gives me the error that "Couldn't open stream {mail.visvas.org:143}". I have configured it by reading the documentation given for webmail - http://drupal.org/node/369604 . My mail server given in the cpanel webmail option is mail.visvas.org
The following settings I have done:
Mail API:
Protocol:IMAPWU
1. Server Hostname: mail.visvas.org
2. Server Port: 143
3. Encryption: none
4. Domain: visvas.org
5. Connection options: {removed all settings written there, means field is blanked}
6. Login Suffix: @visvas.org or +visvas.org (tried both)

Webmail plus:
1. Mail Connection:visvas.org
2. Mail delivery:
Mail Connection:SMTP
SMTP host:mail.visvas.org
SMTP port:25
Encryption:None
Username:pankaj
password: {My password which i m using for opening may email pankaj@visvas.org }
3. Authentication:User defined email password
4. Debugging Settings: Enabled

All other settings which i haven't described are left as default.
I am using drupal-6.10 version and php-5.2.8 having =>IMAP c-Client Version:2006k, SSL Support:enabled, Kerberos Support:enabled.
I have also installed the all required modules for webmail modules.
When i go in the My accounts tab the error comes that -could't open stream. Could anyone please tell what is the problem ?

Error i m getting is

pankajshr_jpr - April 12, 2009 - 14:11

Error i m getting is :

warning: imap_open() [function.imap-open]: Couldn't open stream {mail.visvas.org:143}INBOX in /home/visvas/public_html/campus-compass/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 66.
warning: imap_status(): supplied argument is not a valid imap resource in /home/visvas/public_html/campus-compass/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 86.
warning: imap_check(): supplied argument is not a valid imap resource in /home/visvas/public_html/campus-compass/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 172.
warning: imap_fetch_overview(): supplied argument is not a valid imap resource in /home/visvas/public_html/campus-compass/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 158.
Your email password is not correct. Please click here to set it.

The password for accessing the mail is correct. I can access mail account by cpanel using this password.
what is the problem?

same problem

juanito - April 26, 2009 - 20:02

My problem scenario:
Webmail Plus
password: (password for mail john@example.com)
Drupal user config
username: mr_jones
My account mail: john@example.com

Here was the problem.

Webmail plus was trying to login as mr_jones@example.com (apparently thats how it works, I was confused thinking it would use the drupal user mail configuration).

I changed drupal username to john and problem resolved.

But not everething went fine. It displayed me the mails but when I try to read them I get this.

Fatal error: Call to undefined function webmail_plus_connect() in ....\webmail_plus.thread_view.inc on line 50

I hope it helps

partly solved

juanito - April 26, 2009 - 21:30

I am talking to myself in the way to get webmail plus working I found that apparently these function was beeing called with an old name and the actual function is called : _webmail_plus_connect() so I edited webmail_plus.thread_view.inc and after renaming 3 or 4 different calls to some functions and adding _ prefix I could finally solve the problem.

But not everithing is so shinny.

I get to the message and I cannot see the body, this error:

warning: imap_body() [function.imap-body]: Bad message number in ..\imapwu_api\imapwu_api.module on line 191.

------------
I managed to print the message number and it has nothing to do with the real message number though the url has the message number partly correct eg. if the message is number 12 the URL has http://.../INBOX%412 I forced the number and it displayed it correcly and looking at the other messages, at least in mi case, I get to think that it is a pattern. So for what's left of work I'll try to see where is the url generated and manupulate that variable un the impawu_api.module.

Totally Solved

juanito - April 28, 2009 - 02:59

There are some problems/ confusions with Message Number and Message UID
Problem Solved as follows:

on line 191
replace
$rs = imap_body($_imapwu_api_connection, $msg_number, $options);
with
$real_msgnum=imap_msgno ( $_imapwu_api_connection, $msg_number);
$rs = imap_body($_imapwu_api_connection, $real_msgnum, $options);

I hope this is usefull for other it took me some reading.

If someone can help with display of blocks and folders, I will appreciate that!!

Hi juanito, I have done all

pankajshr_jpr - May 29, 2009 - 04:36

Hi juanito,
I have done all the things you have described above :changed username, modified the impawu_api.module, webmail_plus.functions.inc, webmail_plus.view_folder.inc files as described but still getting the same error

I am talking to myself in the way to get webmail plus working I found that apparently these function was beeing called with an old name and the actual function is called : _webmail_plus_connect() so I edited webmail_plus.thread_view.inc and after renaming 3 or 4 different calls to some functions and adding _ prefix I could finally solve the problem.

could you tell what you have done exactly?

I have followed all the above

okaydave - May 9, 2009 - 12:33

I have followed all the above instructions and I can now use it Webmail Plus, but whenever I access my inbox I get the error message:

user warning: Duplicate entry '13-1-INBOX-219' for key 1 query: INSERT INTO webmail_plus_user_threads_map(tid,uid,folder,message_uid) VALUES(13, 1, 'INBOX', 219) in .../modules/webmail_plus/webmail_plus.module on line 1566

This mesage is repeated several times for a number of duplicate entries with different numbers, going down to '452-1-INBOX-712'.

I'm no expert; any ideas?

I've been waiting for a good webmail module for Drupal for about 2 years. Looks like it's finally here!

Her's what I did with Duplicate entry

juanito - May 13, 2009 - 03:11

Read carefully:

I don't think it's the best solution, but until a this bugs are patched by webmail_plus devs, I did some code mods so that I can use it.

 

For duplicated entries

File: webmail_plus.functions.inc

Find:

foreach($mailboxes as $mailbox_id => $mailbox_name) {

Replace :
if ($mailbox_name=="") continue;
        db_query("INSERT INTO {webmail_plus_user_folders}(uid,folder) VALUES(%d,'%s')", $user->uid, $mailbox_name);

With:
      
  if ($mailbox_name=="")
                {
db_query("INSERT INTO {webmail_plus_user_folders}(uid,folder) VALUES(%d,'%s')", $user->uid, $mailbox_name);
}
else
{
$results = db_query("SELECT folder FROM {webmail_plus_user_folders} WHERE uid='%d' AND folder='%s'", $user->uid,$mailbox_name);
  $folder = db_fetch_array($results);
if ($folder['folder']!=$mailbox_name)
{
db_query("INSERT INTO {webmail_plus_user_folders}(uid,folder) VALUES(%d,'%s')", $user->uid, $mailbox_name);
}
}

I Also solved for my implementation de folders problem where folders appear as {host:port}INBOX.folder
By adding a function that cleans folder name string for output.

For 'move to' option values and folder block listing

File: webmail_plus.functions.inc (I Added it at the top)

Find:

<?php

Add after:
function webmail_plus_clean_folder_name($str)
{
$pos=(strpos($str,'}'));
if ($pos)
{
$pos++;
$pos2=(strpos($str,'.',$pos));
if ($pos2)
{
$pos2++;
$str=substr($str,$pos2,(strlen($str)-$pos2));
}
else
{
$str=substr($str,$pos,(strlen($str)-$pos));
}
}
return $str;
}

For folder block listing

File: webmail_plus.functions.inc

Find:

   // set the session to true
    $_SESSION['webmail_plus']['folders_loaded']=TRUE;
  }

Add after:
  foreach($output as $folder_name=>$folder_junk) {
    $output[$folder_name]=t(webmail_plus_clean_folder_name($folder_name));
    }

For move to option values

File: webmail_plus.view_folder.inc
Replaced:

  $options['move_to_'.$mailbox_name] = t('Move to').' '.$mailbox_name;

With:
  $options['move_to_'.$mailbox_name] = t('Move to').' '.webmail_plus_clean_folder_name($mailbox_name);

I have done all the things

pankajshr_jpr - May 21, 2009 - 18:04

I have done all the things you have described above :changed username, modified the impawu_api.module, webmail_plus.functions.inc, webmail_plus.view_folder.inc files as described but still getting the same error

* warning: imap_open() [function.imap-open]: Couldn't open stream {mail.visvas.org:143}INBOX in /home/visvas/public_html/eboard/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 73.
* warning: imap_status(): supplied argument is not a valid imap resource in /home/visvas/public_html/eboard/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 93.
* warning: imap_check(): supplied argument is not a valid imap resource in /home/visvas/public_html/eboard/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 179.
* warning: imap_fetch_overview(): supplied argument is not a valid imap resource in /home/visvas/public_html/eboard/sites/default/modules/mail_api/contrib/imapwu_api/imapwu_api.module on line 165.

any ideas?

Solved it!

loginsvariaditos - June 1, 2009 - 21:06

At least it worked for me:

I changed the MAIL.API config to:
* Folder prefix: to your mail server. Mine, in localhost, with XAMPP "D:\XAMPP\MercuryMail\MAIL"
* Take off the Connection options parameter

Changes in WEBMAIL_PLUS:
* Mail Delivery: SMTP, port 25 (default)
* Authentication: Internal (Change it cause default is nothing).

And... what solved all my problems: DON´T FORGET TO CONFIG THE AES.MODULE!!
Config:
* Default, and I changed the Key storage method to File.
* Path to file YOUR_SITE\sites\default\files\aes.key (maybe is not the safest way but this is a testing site).
No need to insert key: You normally don't need to worry about this since this module will generate a key for you if none is specified. However...

And it works! Now I have a problem, because the To: field composing a mail, has a valid mails filter, and I cannot send mails to XXX@localhost. It says its not a valid domain. The [dot]whatever missing??

so, loginsvariaditos, how did you do it?

weizrd - June 14, 2009 - 21:34

still getting those 4 errors loginsvariaditos solved

on my cpanel, it tells me this:
Mail Server Username: my.name+sscr.ro
Incoming Mail Server: mail.sscr.ro
Incoming Mail Server: (SSL) ro4.globehosting.net
Outgoing Mail Server: mail.sscr.ro (server requires authentication) port 26
Outgoing Mail Server: (SSL) ro4.globehosting.net (server requires authentication) port 465
Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS (SSL/TLS)
Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS)
* Mac Mail IMAP Note: The "IMAP Path Prefix" needs to be set to INBOX otherwise Mail.app will not be able to store deleted, draft or sent mail on the server. click for more info

so, in mail.api i used what i had noticed in the files of automatic configurations downloaded from cpanel
hostname: mail.sscr.ro
port: 26
no encription
prefix: INBOX (also added to those folders)
removed connection

in webmail:
mail delivery: smtp, mail.sscr.ro, port 25 (not 26), no encription, authent: internal

tried a few hours different combinations i could imagine. (anyway: general question to see if it's worth: any of my users in the website which have emails on the server will be able to check their email through the website, right? - luckily, the usernames on drupal are all the same like on the email, except for me, the admin)

any help is greatly appreciated
thank you

what about the aes.module?

loginsvariaditos - June 15, 2009 - 11:28

could you publish some screenshots of the config?

my config

weizrd - June 15, 2009 - 19:42

forgot to say about AES. at first, when i posted my message, i didn't had it enabled. Then, i enabled it and configured it just how you said and all worked smoothly about it. key was there and everything. however, i still have the errors..

so, screenshots (couldn't upload them here - filtered html):
http://img23.imageshack.us/gal.php?g=picture1tng.png
or http://yfrog.com/0npicture1tngpx

you have in order:
* screenshots from update with all my modules installed (probably not relevant)
* mail api config (starting with picture21.png -scroll down)
* webmail plus config
* cpanel info
* errors after flushed the caches, cron and update..

please tell me: does it work for all the email users on the website? as performance decreases dramatically when I enable webmailplus.

Thank you

looking at it

loginsvariaditos - June 30, 2009 - 11:10

I have been really busy this days. I´ll look at it as soon as possible!
I also have some problems with the folders config. I think my problem is related to Windows Vista folders permissions, in my localhost hosting.
I´ll tell you something asap.

aes settings

weizrd - June 15, 2009 - 19:47

I have got some errors about

pankajshr_jpr - June 16, 2009 - 21:25

I have got some errors about configuring the weight of webmail, file and file_attach modules during installation: http://drupal.org/node/493514

may it cause the connection error?

Account Creation

gumrol - October 21, 2009 - 10:05

Am I smoking pot, or is Webmail Plus supposed to create the Email account on the Email server, when a user signs up?

I've gotten it to work (Webmail Plus version 6.x.1.16) with an existing email account only: thanks all for your great help on this forum.

Now I need the last step in the process, when a user registers, Webmail + needs to create the Email account, so that new users can get email if they want it. Anyone done this, or is Webmail supposed to do it & mine's not functioning 100%?

Thanks in advance.

[ g ]

 
 

Drupal is a registered trademark of Dries Buytaert.