Author Topic: Server Whitelist?  (Read 5282 times)

Offline studio5

  • Newbie
  • *
  • Posts: 4
Server Whitelist?
« 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.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Server Whitelist?
« Reply #1 on: August 06, 2012, 02:46:30 PM »
Are all of the domains on the same mail server?

Offline studio5

  • Newbie
  • *
  • Posts: 4
Re: Server Whitelist?
« Reply #2 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

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Server Whitelist?
« Reply #3 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.

Offline studio5

  • Newbie
  • *
  • Posts: 4
Re: Server Whitelist?
« Reply #4 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;
 

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Server Whitelist?
« Reply #5 on: August 10, 2012, 05:26:27 AM »
The best place to put it would be in a plugin using the authenticate hook.