For many people who have shared hosting, they are required to login with their full email addresses. Personally, I find this irritating. Thus...a very small bit of code to allow people to login both with or without their full address.
File: include/main.inc Function: rcmail_login Line #: 237 Code:
if (strpos($user, '@') == false){ $user = $user . '@' . $CONFIG['domain']; }
File: config/main.inc.php Line #: 35 (doesn't actually matter though) Code:
// Default Domain // Mainly for shared hosting servers. People that use cpanel, etc... // This will allow users to login without typing their full email address // As long as it actually exists on the default domain // The script will check to see if you have a domain in your username. // If not, this will be added to the end. // Set this to whatever comes after the @ in the email address $rcmail_config['domain'] = 'mydomain.com';
first, a note on strpos(). the result needs to be checked with the '===' operator to catch the difference between 0 or '' and FALSE. http://au2.php.net/strpos for more.
second, i'm not sure if the roundcube dev's want this functionality in or not, but wont this patch add the '@' and (if its set) the $CONFIG['domain'] string to all users logins, regardless of whether they need it?
assuming there is interest in incorporating this, i think the patch for program/include/main.inc shoule read:
if ($CONFIG['domain']) {
if (strpos($user, '@') === false) { $user .= $CONFIG['domain']; }
}
and the instructions in config/main.inc.php should include a directive to leave $CONFIG['domain'] set to false if not needed.
cheers justin
dianoga7@3dgo.net wrote:
For many people who have shared hosting, they are required to login with their full email addresses. Personally, I find this irritating. Thus...a very small bit of code to allow people to login both with or without their full address.
File: include/main.inc Function: rcmail_login Line #: 237 Code:
if (strpos($user, '@') == false){ $user = $user . '@' . $CONFIG['domain']; }
File: config/main.inc.php Line #: 35 (doesn't actually matter though) Code:
// Default Domain // Mainly for shared hosting servers. People that use cpanel, etc... // This will allow users to login without typing their full email address // As long as it actually exists on the default domain // The script will check to see if you have a domain in your username. // If not, this will be added to the end. // Set this to whatever comes after the @ in the email address $rcmail_config['domain'] = 'mydomain.com';
Good points there. I forgot about the extraneous @ that would be added.
As far as the strpos thing goes, I don't think having an @ symbol as the first character of an email address is possible. However, your modification is probably better as far as good coding goes.
Thanks, ~Brian
On Fri, 14 Oct 2005 10:23:06 +1000, justin randell justin@babel.com.au wrote:
first, a note on strpos(). the result needs to be checked with the '===' operator to catch the difference between 0 or '' and FALSE. http://au2.php.net/strpos for more.
second, i'm not sure if the roundcube dev's want this functionality in or not, but wont this patch add the '@' and (if its set) the $CONFIG['domain'] string to all users logins, regardless of whether they need it?
assuming there is interest in incorporating this, i think the patch for program/include/main.inc shoule read:
if ($CONFIG['domain']) {
if (strpos($user, '@') === false) { $user .= $CONFIG['domain']; }
}
and the instructions in config/main.inc.php should include a directive to leave $CONFIG['domain'] set to false if not needed.
cheers justin
dianoga7@3dgo.net wrote:
For many people who have shared hosting, they are required to login with their full email addresses. Personally, I find this irritating. Thus...a very small bit of code to allow people to login both with or without their full address.
File: include/main.inc Function: rcmail_login Line #: 237 Code:
if (strpos($user, '@') == false){ $user = $user . '@' . $CONFIG['domain']; }
File: config/main.inc.php Line #: 35 (doesn't actually matter though) Code:
// Default Domain // Mainly for shared hosting servers. People that use cpanel, etc... // This will allow users to login without typing their full email
address
// As long as it actually exists on the default domain // The script will check to see if you have a domain in your username. // If not, this will be added to the end. // Set this to whatever comes after the @ in the email address $rcmail_config['domain'] = 'mydomain.com';
There are plans to implement the use of a virtusertable file to resolve real usernames by e-mail addresses. Until this is done, you could fill in the 'alias' col for registered users directly in your MySQL admin interface. This alias can be set to any string (not necessarly to the e-mail address) and will be searched on login.
Regards, Thomas
dianoga7@3dgo.net wrote:
For many people who have shared hosting, they are required to login with their full email addresses. Personally, I find this irritating. Thus...a very small bit of code to allow people to login both with or without their full address.
File: include/main.inc Function: rcmail_login Line #: 237 Code:
if (strpos($user, '@') == false){ $user = $user . '@' . $CONFIG['domain']; }
File: config/main.inc.php Line #: 35 (doesn't actually matter though) Code:
// Default Domain // Mainly for shared hosting servers. People that use cpanel, etc... // This will allow users to login without typing their full email address // As long as it actually exists on the default domain // The script will check to see if you have a domain in your username. // If not, this will be added to the end. // Set this to whatever comes after the @ in the email address $rcmail_config['domain'] = 'mydomain.com';
I'm not at my computer, so I can't paste the code here, but I've actually used an environment variable to get the domain from the URL and then I've hidden the domain box.
On my server I've put roundcube (which rocks btw, congrats) on the generic webmail subdomain so it can be accessed from any domain. By detecting the domain in the URL, accessing it at webmail.domain1.com means that any username will automatically have @domain1.com appended to it (unless it already has an @, of course).
I'm not sure if you've plans for something similar to this in the future, or if there was a reason for not doing it, but it works great for my needs and makes the login screen that little bit simpler.
Ian
thomas brüderli wrote:
There are plans to implement the use of a virtusertable file to resolve real usernames by e-mail addresses. Until this is done, you could fill in the 'alias' col for registered users directly in your MySQL admin interface. This alias can be set to any string (not necessarly to the e-mail address) and will be searched on login.
Regards, Thomas
dianoga7@3dgo.net wrote:
For many people who have shared hosting, they are required to login with their full email addresses. Personally, I find this irritating. Thus...a very small bit of code to allow people to login both with or without their full address.
File: include/main.inc Function: rcmail_login Line #: 237 Code:
if (strpos($user, '@') == false){ $user = $user . '@' . $CONFIG['domain']; }
File: config/main.inc.php Line #: 35 (doesn't actually matter though) Code:
// Default Domain // Mainly for shared hosting servers. People that use cpanel, etc... // This will allow users to login without typing their full email address // As long as it actually exists on the default domain // The script will check to see if you have a domain in your username. // If not, this will be added to the end. // Set this to whatever comes after the @ in the email address $rcmail_config['domain'] = 'mydomain.com';
On 10/14/05, thomas brüderli thomas@brotherli.ch wrote:
There are plans to implement the use of a virtusertable file to resolve real usernames by e-mail addresses. Until this is done, you could fill in the 'alias' col for registered users directly in your MySQL admin interface. This alias can be set to any string (not necessarly to the e-mail address) and will be searched on login.
Regards, Thomas
My only concern is that this file won't scale well with the number of users. The two simple solutions are a dropdown box with the domain you want or a default domain to append. Virtual user lookups are expensive and what if you have 2 bob's?
bob@domain1.com bob@domain2.com
-- Christopher A. Watford christopher.watford@gmail.com
Christopher A. Watford wrote:
On 10/14/05, thomas brüderli thomas@brotherli.ch wrote:
[..]
My only concern is that this file won't scale well with the number of users. The two simple solutions are a dropdown box with the domain you want or a default domain to append. Virtual user lookups are expensive and what if you have 2 bob's?
bob@domain1.com bob@domain2.com
A virtusertable file like used for sendmail or postfix configuration resolves e-mail addresses (i.e. bob@domain1.com) with the local mailbox user name (i.e. bob_one). In that case you don't need to select the host on the login screen but enter your full e-mail address as user name.
Once that user is resolved from the virtusertable, it'll be saved in the users table (alias) and don't has to be resolved from the file again on the next login.
Do you understand, what we intend to do?
Thomas
On 10/14/05, Thomas Bruederli roundcube@gmail.com wrote:
Christopher A. Watford wrote:
On 10/14/05, thomas brüderli thomas@brotherli.ch wrote:
[..]
My only concern is that this file won't scale well with the number of users. The two simple solutions are a dropdown box with the domain you want or a default domain to append. Virtual user lookups are expensive and what if you have 2 bob's?
bob@domain1.com bob@domain2.com
A virtusertable file like used for sendmail or postfix configuration resolves e-mail addresses (i.e. bob@domain1.com) with the local mailbox user name (i.e. bob_one). In that case you don't need to select the host on the login screen but enter your full e-mail address as user name.
Once that user is resolved from the virtusertable, it'll be saved in the users table (alias) and don't has to be resolved from the file again on the next login.
Do you understand, what we intend to do?
Thomas
Yep, but my thoughts are:
1). Too expensive, past 1000 users the lookups take valuable time. If they're in MySQL, then its not so bad, but why waste another MySQL lookup that Courier-AUTHLIB will be doing anyways (or whatever your IMAP server's auth system does). 2). There are much simpler approaches than following Postfix's local/virtual transport maps, such as 'default' domain and the list of domains. These would be instantly beneficial, they don't suffer from duplicate email issues, and impose no extra load time.
-- Christopher A. Watford christopher.watford@gmail.com
How will this work with virtusertables already being mysql ? or another format ?
How about looking at the REQUEST_HOST, and automatically appending that domain ? These are all things that people have done with squirrelmail/webmail etc. I'm willing to bet $10 of my own hard earned dollars, that the people who end up deploying this the most will have
http://webmail.domain.com http://webmail.domain2.com
for their users, going the virtuser way may seem like a nice thing to do right now, but it will become a nightmare eventually. I'm with Chris on this.
Thomas Bruederli wrote:
Christopher A. Watford wrote:
On 10/14/05, thomas brüderli thomas@brotherli.ch wrote:
[..]
My only concern is that this file won't scale well with the number of users. The two simple solutions are a dropdown box with the domain you want or a default domain to append. Virtual user lookups are expensive and what if you have 2 bob's?
bob@domain1.com bob@domain2.com
A virtusertable file like used for sendmail or postfix configuration resolves e-mail addresses (i.e. bob@domain1.com) with the local mailbox user name (i.e. bob_one). In that case you don't need to select the host on the login screen but enter your full e-mail address as user name.
Once that user is resolved from the virtusertable, it'll be saved in the users table (alias) and don't has to be resolved from the file again on the next login.
Do you understand, what we intend to do?
Thomas
Hi !!
My only concern is that this file won't scale well with the number of users. The two simple solutions are a dropdown box with the domain you want or a default domain to append. Virtual user lookups are expensive and what if you have 2 bob's?
i think the user's email should be externally fixed to avoid users getting other's users identity, maybe just adding a config option with a PEAR:DB query to use when the username is not an email address (so it could be attached to any sort on existing db with that information). Leting the user choose it's email address is not safe (as it's not safe to user the same username/password to do smtp auth for all users)
Hi !!
In that case you don't need to select the host on the login screen but enter your full e-mail address as user name.
the probem is that on Mac, specially Entourage, refuses to work with usernames that contain a @ character, so many of our users username is user.domain.com or another.user.domain.com. One good aproach will be:
only of first login:
a) if the username does not have a @, and if a external query has been configured, execute the query to get the real email b) if the username does not have a @, and if a default domain has been configured, append the configured domain to the user's username c) if the username does not have a @ the use the apache virtual hostname (striping the initial www. if present) and append the hostname domain to the user's username (note that this will not work in servers other than apache)
Once that user is resolved from the virtusertable, it'll be saved in the users table (alias) and don't has to be resolved from the file again on the next login.
that's perfect
1). Too expensive, past 1000 users the lookups take valuable time. If they're in MySQL, then its not so bad, but why waste another MySQL lookup that Courier-AUTHLIB will be doing anyways (or whatever your IMAP server's auth system does).
as the real email has been saved in Rounbdcube own's database this will not be exepensive (one only query for the firt login of each user)
On 10/14/05, David Saez Padros david@ols.es wrote:
Hi !!
In that case you don't need to select the host on the login screen but enter your full e-mail address as user name.
the probem is that on Mac, specially Entourage, refuses to work with usernames that contain a @ character, so many of our users username is user.domain.com or another.user.domain.com. One good aproach will be:
I've used the % fix in previous installations: user%domain.com. Most IMAP servers can handle this on the fly.
only of first login:
a) if the username does not have a @, and if a external query has been configured, execute the query to get the real email b) if the username does not have a @, and if a default domain has been configured, append the configured domain to the user's username c) if the username does not have a @ the use the apache virtual hostname (striping the initial www. if present) and append the hostname domain to the user's username (note that this will not work in servers other than apache)
Once that user is resolved from the virtusertable, it'll be saved in the users table (alias) and don't has to be resolved from the file again on the next login.
that's perfect
1). Too expensive, past 1000 users the lookups take valuable time. If they're in MySQL, then its not so bad, but why waste another MySQL lookup that Courier-AUTHLIB will be doing anyways (or whatever your IMAP server's auth system does).
as the real email has been saved in Rounbdcube own's database this will not be exepensive (one only query for the firt login of each user)
What I'm saying is any access to MySQL is expensive. 1 extra query just at login is almost too much.
Queries: 164.2M qps: 1438 Slow: 90.0 Se/In/Up/De(%): 94/01/02/00 qps now: 467 Slow qps: 0.0 Threads: 88 ( 14/ 82) 59/10/07/03 Cache Hits: 154.7M Hits/s: 372.8 Hits now: 91.0 Ratio: 91.0% Ratio now: 57.4% Key Efficiency: 100.0% Bps in/out: 6.5k/ 2.7k Now in/out: 33.1k/600.6k
My customers would not like another query per login... with 2515 users logged into email at this moment that may only translate to another 3-5/second, but hey each one counts.
I'm fine with the option being there, it adds a ton of flexibility, however simpler ones must be made available so that large installs are not hamstringed (hamstrung?) with extraneous database usage.
-- Best regards ...
The dentist said my wisdom teeth were retarded.
David Saez Padros http://www.ols.es On-Line Services 2000 S.L. e-mail david@ols.es Pintor Vayreda 1 telf +34 902 50 29 75 08184 Palau-Solita i Plegamans movil +34 670 35 27 53
-- Christopher A. Watford christopher.watford@gmail.com
Hi !!
as the real email has been saved in Rounbdcube own's database this will not be exepensive (one only query for the firt login of each user)
What I'm saying is any access to MySQL is expensive. 1 extra query just at login is almost too much.
but it's only the very first login, once RoundCube knows the email it never does the query again. Nevertheless as what i propose is based on PEAR:DB you can make sqlite queries which are very fast, or you can configure no query and no query will be done.
I'm fine with the option being there, it adds a ton of flexibility, however simpler ones must be made available so that large installs are not hamstringed (hamstrung?) with extraneous database usage.
that's exactly what i propose, you can configure a query (if you want) or a default domain or Roundcube could just pick the virtual server name, only if the username does not have a @ or %