Roundcube Community Forum

 

Server Whitelist?

Started by studio5, August 06, 2012, 12:04:33 PM

Previous topic - Next topic

studio5

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.

SKaero

Are all of the domains on the same mail server?

studio5

Thanks for your reply.

No different mail servers:

mail.example1.com
mail.example2.com
mail.example3.com

SKaero

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.

studio5

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;

SKaero

The best place to put it would be in a plugin using the authenticate hook.