Release Support > Release Candidate 2

Automatically figuring out host with email login???

(1/2) > >>

blove57:
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'];

OJM:
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...?

blove57:
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']) ? '' : '';", 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.substring(document.getElementById('rcmloginuser').value.substring(0,document.getElementById('rcmloginuser').value.lastIndexOf('@')+1).length,document.getElementById('rcmloginuser').value.length+1)

So all I have to do in the form is this (notice just the onsubmit):


Then I can make the 'rcmloginhost' input hidden. I'm getting closer but really need help from a RoundCube coder or guru. Any ideas?

OhYa:
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

sebastian:
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 :-)

Navigation

[0] Message Index

[#] Next page

Go to full version