![]() |
|
|
|||||||
| For more information about the ads and why they're here, please see the FAQ |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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']))
|
|
#3
|
|||
|
|||
|
Nice! Thanks for the code!
![]() |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
| For more information about the ads and why they're here, please see the FAQ |