![]() |
|
|
|||||||
| For more information about the ads and why they're here, please see the FAQ |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have users from many different domains logging into Roundcube webmail. Because of this I left this blank in main.inc.php:
$rcmail_config['default_host'] = ''; The problem is users find this really confusing when they have an emails address, password and host to fill out during the log in page. What I'd like to do is get the domain from the email loggin and place is in the $rcmail_config['default_host'] value. So for example, when someone logs in as john@fundomain.com, the host should automatically be valued at fundomain.com. In the wiki it says: // Automatically add this domain to user names for login // Only for IMAP servers that require full e-mail addresses for login // Specify an array with 'host' => 'domain' values to support multiple hosts // $serverut = $_SERVER['SERVER_NAME']; <<< get the server name example www.site.com // $wsrt = 'www.'; <<< string to replace // $serverput = str_replace($wsrt,'',$serverut); <<< replace the host address deleting the www in this case // $rcmail_config['username_domain'] = $serverput; <<< and the var is ready! The problem with this is that SERVER_NAME is already figured out before the users fills it their information. I want to fill the host value after the user has filled their information. How would I implement this? |
|
#2
|
|||
|
|||
|
This is exactly what I'd like to achieve aswell.
Off the top of my head, the SMTP user authentication uses '%u' as the username of the account. Would it be possible to find out how this is being set, and add another function to strip off the @ sign and everything before? You could then use this new 'function' to pass through as the host name...? |
|
#3
|
|||
|
|||
|
I'm also trying to tackle this. The RoundCube code doesn't really seem to be coded for change. What I was going to do is hack the login page with Javascript. All I need to do is add an onsubmit to the form in roundcube\program\include\rcmail_template.inc. I was going to add it in this line "$form_start = !strlen($attrib['form']) ? '<form name="form" action="./" method="post">' : '';", but that just creates a 2nd form if I mess with the conditions.
To get the domain from the email address, this is the formula I was going to use: document.getElementById('rcmloginuser').value.subs tring(document.getElementById('rcmloginuser').valu e.substring(0,document.getElementById('rcmloginuse r').value.lastIndexOf('@')+1).length,document.getE lementById('rcmloginuser').value.length+1) So all I have to do in the form is this (notice just the onsubmit): <form name="form" action="./" method="post" onsubmit="document.getElementById('rcmloginhost'). value = "mail." + document.getElementById('rcmloginuser').value.subs tring(document.getElementById('rcmloginuser').valu e.substring(0,document.getElementById('rcmloginuse r').value.lastIndexOf('@')+1).length,document.getE lementById('rcmloginuser').value.length+1)"> Then I can make the 'rcmloginhost' input hidden. I'm getting closer but really need help from a RoundCube coder or guru. Any ideas? |
|
#4
|
|||
|
|||
|
I need to do this as well...
Anyone have any updates on this? Exactly what I need to do is this, I have several domains with a few users on each. So I need them to be able to login to a single webmail.MyMainDomain.com Thanks |
|
#5
|
|||
|
|||
|
Looking also for this feature ... but I need to configure different mail-servers according to the login.
Like user1@domain1.com uses domain1-mail.somedomain.com; user2@domain2.com uses domain2-mail.somedomain.com, etc. Looking forward to such feature :-) |
![]() |
| 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 |