Roundcube Community Forum

Release Support => Requests => Topic started by: studio5 on August 06, 2012, 12:04:33 PM

Title: Server Whitelist?
Post by: studio5 on August 06, 2012, 12:04:33 PM
Is there a way I can restrict who uses my RC?

The only changes I have made are:
$rcmail_config['default_host'] = 'mail.%s';

But the only people I want using my RC are:
@example.com - Yes
@example1.com - Yes
@example2.com - Yes
Anybody else - no

I have spent hours researching this to no avail, it looks like I will need to create a pre-login login page to check if the account they want login with is allowed.
Title: Re: Server Whitelist?
Post by: SKaero on August 06, 2012, 02:46:30 PM
Are all of the domains on the same mail server?
Title: Re: Server Whitelist?
Post by: studio5 on August 08, 2012, 06:41:42 AM
Thanks for your reply.

No different mail servers:

mail.example1.com
mail.example2.com
mail.example3.com
Title: Re: Server Whitelist?
Post by: SKaero on August 08, 2012, 05:00:07 PM
You can setup $rcmail_config['default_host'] with an array to give a list of hosts but then the user would have to select the mail server. Otherwise you'll need to turn to a plugin to do what you want.
Title: Re: Server Whitelist?
Post by: studio5 on August 09, 2012, 06:41:54 AM
Thanks again for your reply,

Where in the code would it be best to put a 'must contain' operation?

e.g.
if(!email.contains(example1.com || example2.com || example3.com))
return false;
else
return true;
Title: Re: Server Whitelist?
Post by: SKaero on August 10, 2012, 05:26:27 AM
The best place to put it would be in a plugin using the authenticate hook.