Opened 7 years ago

Closed 7 years ago

#1484507 closed Feature Patches (wontfix)

Automatic setting of username_domain config variable

Reported by: zextra Owned by:
Priority: 3 Milestone:
Component: Core functionality Version: 0.1-rc1
Severity: minor Keywords: login config
Cc: zextra@…

Description

In my server setup, every domain gets subdomain webmail.domain.com, which points to local roundcube installation. Since I'm using vpopmail, usernames are in form username@…, and it's handy to have domain name automatically appended upon login attempt, so user would have only to enter username part of the string, along with correct password.

I've solved that with following patch.

$ diff main.inc.php.dist main.inc.php
46c47,52
< $rcmail_config['username_domain'] = '';
---
> if ( preg_match( '/^webmail\.(.*)$/', $_SERVER['HTTP_HOST'], $match ) ) {
>       $rcmail_config['username_domain'] = $match[1];
> }
> else {
>       $rcmail_config['username_domain'] = '';
> }

It could be solved in more sophisticated way (by putting processing logic in some script, and leaving few more config options to control RC behaviour), but my point was to show that it's easily possible (and to make it work for me, of course).

Change History (1)

comment:1 Changed 7 years ago by thomasb

  • Milestone 0.1-stable deleted
  • Resolution set to wontfix
  • Status changed from new to closed

No patch necessary. Use $rcmail_config['username_domain'] config parameter for this.

Note: See TracTickets for help on using tickets.