From: Paul L. <pa...@sq...> - 2006-10-18 15:45:39
|
On 10/17/06, nettty <net...@ya...> wrote: > Hello, > > > > > > > I want to auto-detect server IP, something like > > > > this: > > > > > > > > ================================================= > > > > > $email =$_POST["login_username"]; > > > > > $domain= substr(strstr($email, '@'), 1); > > > > > $hosts=gethostbynamel(mail.$domain); > > > > > if (is_array($hosts)) > > > > > { > > > > > foreach ($hosts as $ip) > > > > > { > > > > > $server=$ip; > > > > > } > > > > > } > > > > > else > > > > > { > > > > > header("Location: login.php"); > > > > > exit; > > > > > } > > > > > > > > ================================================= > > > > > I have just started to use multilogin. With us > > > > > mailserver IP can be simply detected for almost > > > > all > > > > > cases by using "mail.domain.com". Our users are > > > > simply > > > > > > > > So then why not use Vlogin and make it prefix the > > > > given domain with > > > > "mail."? Sounds like you don't really want to > > > have > > > > your users make > > > > their mail server selection, so dump multilogin > > > and > > > > please have a look > > > > at: > > > > > > > > http://www.squirrelmail.org/plugin_view.php?id=47 > > > > > > > > Also note that it is not necessarily recommended > > > to > > > > trust what the > > > > user gives you for the domain (and it's much nicer > > > > for the user not to > > > > have to type it in). The domain can be understood > > > > from the login URI > > > > instead. Either way is possible, have a read of > > > the > > > > Vlogin README > > > > file. > > > > Thanks for the prompt response. > > I indeed looked at vlogin first and couldnt get it > > working as needed. Probably i overlooked its > > details. > > Can you tell me if i enable "usernameDomainIsHost", > > this will do what i need to do here? > > >Yes, but for the sake of your users, I would recommend if there is any > >other way to determine the domain (user map or login URI, etc) that > >you use that instead. You'll probably also need to look at > >$always_prepend. > > ## Sorry i cant find any documentation on this. where do i need to add/enable this. Uh, in the README file? The sample config file(s)? Did you read those? Search for that config parameter therein? > I'll sure try to create a some hostmap in near future. > Login URI contains an IP, so it is no help for me. Odd. Is there some reason you can't serve DNS inside your organization? Also, I'm not sure, but it might be possible to put the IP address as the server name in $virtualDomains (but not helpful if everyone uses the same IP) > >>> Also currently i have a seperate "data" directory to > >>> store preferences of each IMAP/mail server, using > >>> multilogin. > >>> How can i do the same with vlogin. > > >Well, you can set up a data_directory setting in several places in > >vlogin, you just have to determine where the best place is -- a > >typical installation has a different URI for each domain grouping of > >users, so putting a data_directory definition for each domain in the > >$virtualDomains array is appropriate in that situation. > > ## I'm moving from a per-server squirrel (for 4 mail servers) install that already have > almost 1.5GB of data in "data" directory per server. I'll merge them all into one for now. > Had i been using vlogin earlier, per domain data dir would have been good for me. Any > pointers on moving to such a setup frmo what i have will help. Dunno. You could also just keep one directory and turn on hashing (probably level 4 for you), which would speed things up a lot. In the end, you have to provide a way to differentiate users into groupings (surely there is some logic), and upon that is how vlogin can provide different settings. Note that there are a lot of options, all listed in the README -- sendmail-style alias table, SQL-based grouping (with any query you want), user-based server (and other) settings, etc. Also, have you considered Perdition instead of Vlogin? |