Menu

Limit Popfile to works with recognized users?

HOWTO
Erik_vpj
2007-02-28
2013-04-15
  • Erik_vpj

    Erik_vpj - 2007-02-28

    Hi!
    This is the question.

    How to Limit Popfile to works only with recognized users?

    I have installed POPFile on a server on the web.
    I share this server with friends, but virtually  a lot of people that I don't know can access to my PopFile server.

    How can i limit Popfile to call only the POP that i want, and only certain mailbox?

    Thanks
    Erik

     
    • Manni

      Manni - 2007-03-02

      Hi,

      I'm afraid that POPFile currently is not able to do what you want. You coul modify POPFile though to check for a specific pop3 host and a specific user name. Check the $user_command regular expression that is defined on line 191 in the file Proxy/POP3.pm.

      Regards,
      Manni

       
      • Erik_vpj

        Erik_vpj - 2007-03-02

        Thanks for the Hint.
        Now I Try to study the thing, but i'm not a programmer :)

        I want to create a list of user:pop allowed to use my PopFile.
        Do you think that is possible?

        If you have some time for me... when you can...i'll wait for another hint

        thanks a lot
        Erik

         
        • Manni

          Manni - 2007-03-02

          Yes, I think that this is possible.

          On the line I quoted earlier, we currently have this:

          my $user_command = "USER ([^$s]+)($s(\\d+))?$s([^$s]+)($s([^$s]+))?";

          You could turn that into

          my $user_command = "USER (host1|host2|host3)($s(\\d+))?$s(user1|user2|user3)($s([^$s]+))?";

          This will limit you to certain host and user names (although you will not be able to specify which user is allowed on which host).

          Simply replace host1..3 with your desired pop3 hostnames and append new ones with a |. Same goes for the user names.

          Warning: The code above is NOT tested.

          Regards,
          Manni

           
          • Erik_vpj

            Erik_vpj - 2007-03-02

            Yeah ;)
            It Works!

            Yes, i can't assign the exact user to the POP, but this is enought for me.
            Thanks a lot

            If you pass in Italy i have a good bottle of Wine for you ;)

            Ciao
            Erik

             
          • Erik_vpj

            Erik_vpj - 2007-04-13

            Hi Manni

            I'm here again.
            Well, all seems to work until today, but now i have a new problem.

            I have a new email, and the user of this email is like this: user@site.com

            and this seems to be a problem beacause if I modify the line
            my $user_command = "USER (Pop of the emails)($s(\\d+))?$s(user@site.com)($s([^$s]+))?";

            The "@" is a problem but i have to use the @ to log on the Pop
            Popfile can't start

            What can I do?

            Thank a lot
            Erik

             
            • Manni

              Manni - 2007-04-13

              Hi Erik,

              try escaping the @ with a back slash: \@

              Hope this helps,
              Manni

               
              • Erik_vpj

                Erik_vpj - 2007-04-13

                Ehehehe at the same time....

                Yes it works!

                I've read this line some minutes ago and with some experiments i have understood to use \@
                $s =~ s/(\$|\@|\[|\]|\(|\)|\||\?|\*|\.|\^|\+)/\\$1/;

                However thanks a lot for your speeed

                Have a good Day

                Erik

                 

Log in to post a comment.