RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Release Support > Release Discussion

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 08-23-2007, 02:13 PM
Registered User
 
Join Date: Aug 2007
Posts: 2
Downloads: 0
Uploads: 0
Default RoundMail configuration for multiple domain names - identities problem

Hi all,

I’ve only had RoundCube running for about an hour now, so excuse any of my n00b stupidity please.

It’s all working now, however the “identities” concept doesn’t seem to work too well for us.

We have about 80 domain names on a mail server, which I have pointed RoundCube at.

All of the accounts use the full email address as the user name. I have set:

$rcmail_config['default_host'] = 'mail.fueladvance2.com';

With that combination, any of our users could login fine.

However – sending mail doesn’t work until you manually create an identity. This isn’t a great first-run experience, and I don’t want to have to write some sort of script to sync the mail server accounts with the RoundCube identities table.

Is there a simple mod I can make that bypasses this concept of identities and just says “use the username as the from address” ?

I have already configured:

$rcmail_config['smtp_server'] = 'mail.fueladvance2.com';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
$rcmail_config['smtp_auth_type'] = '';

Any suggestions?

Great so far otherwise! I'm excited about using this product.


Thanks,

Tatham Oddie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 08-24-2007, 02:26 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Downloads: 0
Uploads: 0
Default Re: RoundMail configuration for multiple domain names - identities problem

Ok everyone - this is the resolution I came up with. It was my first time ever touching PHP, so a bit hackish, but it works.

DIFF:



Code:
Index: program/steps/mail/sendmail.inc
===================================================================
--- program/steps/mail/sendmail.inc	(revision 6556)
+++ program/steps/mail/sendmail.inc	(working copy)
@@ -41,26 +41,11 @@
  {
  global $DB, $OUTPUT;
  
- // get identity record
- $sql_result = $DB->query("SELECT *, email AS mailto
-              FROM ".get_table_name('identities')."
-              WHERE identity_id=?
-              AND  user_id=?
-              AND  del<>1",
-              $id,$_SESSION['user_id']);
-                  
- if ($DB->num_rows($sql_result))
-  {
-  $sql_arr = $DB->fetch_assoc($sql_result);
-  $out = $sql_arr;
-  $name = strpos($sql_arr['name'], ",") ? '"'.$sql_arr['name'].'"' : $sql_arr['name'];
-  $out['string'] = sprintf('%s <%s>',
-               rcube_charset_convert($name, RCMAIL_CHARSET, $OUTPUT->get_charset()),
-               $sql_arr['mailto']);
-  return $out;
-  }
-
- return FALSE; 
+ $out['string'] = sprintf('%s <%s>',
+               $_SESSION['username'],
+               $_SESSION['username']);
+ return $out;
+ 
  }
 
 /**
@@ -159,7 +144,7 @@
 $to_address_arr = $IMAP->decode_address_list($mailto);
 $identity_arr = rcmail_get_identity(get_input_value('_from', RCUBE_INPUT_POST));
 
-$from = $identity_arr['mailto'];
+$from = $_SESSION['username'];
 $first_to = is_array($to_address_arr[0]) ? $to_address_arr[0]['mailto'] : $mailto;
 
 if (empty($identity_arr['string']))
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 08-24-2007, 03:16 AM
Super Moderator
 
Join Date: Jun 2006
Posts: 431
Downloads: 0
Uploads: 0
Send a message via ICQ to skaero Send a message via AIM to skaero Send a message via MSN to skaero Send a message via Yahoo to skaero
Default Re: RoundMail configuration for multiple domain names - identities problem

Nice! Thanks for the code!
__________________
[size=8pt]SKaero.com <br />&nbsp; [/size]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 03:27 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community