Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Only allow users from company domain to register or create a ticket

osTicket version: v1.9.14

I'm' trying to create a filter to only allow company emails to register.  See attached file for setup details.
Registration emails are getting through eventhough I'm not using the 'company.com' email address.  Not sure what I'm doing wrong or missing.  

Any ideas?  Thanks.





Comments

  • image
    filter.PNG
    971 x 645 - 58K
  • No attached file.
    You haven't shared your filter config.
    Registration emails do not go to osTicket so I'm not real sure what you mean by they are getting through.
  • File added...do you see it?

    image

  • Using REGEX to parse email is tricksy (like hobbits).
    You appear to be assuming that the TO field will only have one email address in it, and no name.

    Is it possible that your email headers are formatted like this:
    Neil Test <N.Test@company.com>

    I think that you would be better off changing "Does Not Match REGEX" to "Does Not contain" and put the domain in the pattern.
  • I initially had it set to "Does Not Contain" w/ domain pattern, but it wasn't working so I went the REGEX route.  I just changed it back to using "Does Not Contain", tested and the registration is still going through (email not from "@company.com")
    image
    filter2.PNG
    938 x 664 - 57K
  • Try removing the @ symbol?
  • Yes, still doesn't work.
  • What do you mean by "Registration emails are getting through"

    How are you testing?
  • edited September 2016
    I go to the web portal account registration page and sign up for a new account 

    (this is going through my domain)


    image
    os_account.PNG
    813 x 507 - 38K
  • Hello richardw,

    why not this:

    http://osticket.com/forum/discussion/88559/allow-only-users-from-specific-domain-com-from-registering#latest

    ...

    here my solution:

    edit: \upload\include\class.validator.php

    function is_valid_email($email) {
    global $cfg;

    $domain_suffix = substr(strrchr($email, "@"), 1);
    $tld_allow = array("example.de", "example.com");

    if (!in_array($domain_suffix, $tld_allow)) {
    return FALSE;
    }

    else
    // Default to FALSE for installation
    return self::is_email($email, false, $cfg && $cfg->verifyEmailAddrs());
    }


    and unset "Verify email address domain" in osTicket __ Admin Control Panel


    if the e-mail suffix is not example.de or example.com the user can't register


    Best Regards
    citrixraptor
  • Thank you citrixraptor....I saw that "fix", but I prefer not to have to create custom code if this can be accomplished through the admin console (which seems pretty straightforward).  
  • Ticket filters... are filters that run when you open a ticket (via the ui or email or api, or all of the above).
    They will not prevent someone from registering for an account...

  • Hello richardw,

    >> Thank you citrixraptor....I saw that "fix", 
    You are welcome ..

    >> but I prefer not to have to create custom code if this can be accomplished through the admin 
    >> console (which seems pretty straightforward). 
    Understand your point of view ... is this perhaps a solution - see 01.jpg ... allowed mail domains via admin panel?

    Best Regards
    citrixraptor
    01.jpg
    926 x 277 - 53K
  • edited September 2016
    That field does not exist in an unmodified 1.9.14, or in 1.10rc3.
  • edited September 2016
    Hello ntozier, 
     your are right! ... but now allowed mail domains are managed by admin panel 

    But a good add .. i think

    Best Regards

    citrixraptor

  • Thanks citrixraptor/ntozier for you assistance...definitely sounds like a good added feature for the future.
  • Hello richardw,

    >> Thanks citrixraptor/ntozier for you assistance...
    You are welcome ...

    >> definitely sounds like a good added feature for the future.
    me2

    Best Regards
    citrixraptor
Sign In or Register to comment.