On Wednesday 26 February 2003 16:40, Kurt Bigler wrote: > on 2/26/03 8:38 AM, Jesse Guardiani <[EMAIL PROTECTED]> wrote: > > ----- Original Message ----- > > From: "Jesse Cablek" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, February 26, 2003 10:51 AM > > Subject: Re: [sqwebmail] new file proposal > > > >> Jesse Guardiani wrote:
<snip> > > *:mail.*:*allvirtual > > As most of the previous examples over the last week or so have illustrated, > this is exactly the kind of thing we were already trying to accomplish in > many cases by listing all the domains explicitly, i.e. in my case > essentially to "remove" all the "webmail." prefixes in order to obtain the > login domain. Yes. This is the "simple to implement" method. The first method I chose. > > You had already balked at regular expressions, so I didn't even dare to > mention this yesterday! I guess you're a one-change-at-a-time kind of guy. You hit the nail on the head. I like to build on the code I've already written. Once I implemented your suggestions for the logindomainlist file, my mind instantly started exploring the possibilities beyond that, and now that it's not that large of a mental jump to envision, I'm willing to write it. Some functionality is better envisioned from the top down, but in this case, I think it was better to write it from the bottom up, using a file format that is flexible and capable of future change. > > Would you do this exactly the same way that shells do globbing? Of course > there is no need to special case domains starting with a ".". > > You are going one step farther than globbing by using "*" on the replace > side of the equation. Hmm... remind me, is there already precedent for > this in unix somewhere? Maybe. But I think I'm going to keep it simple. Implementing this simple wildcard functionality will, I think, solve 98% of the generic problems that people will encounter with email domains. In the future, replacing the wildcard functionality with regular expression matching is possible, but I have other projects beating on my door, and I have to wrap this up quickly. The wildcarding algorithm I've been toying with for the second field will simply remove everything before the asterisk, and everything after the asterisk from the beginning and end of the SERVER_ADDR and HTTP_HOST variables, respectively, BEFORE attempting a strcmp() function. In the first field, whatever was eventually matched in the second field will be inserted where the asterisk is. Or, more programmatically, everything before the asterisk and everything after the asterisk will be prepended and appended, respectively, to whatever string actually passed the strcmp() function from the second field. This will be easy to implement, and should offer enough functionality to keep 98% of the administrators out there happy. > > Globbing normally involves the possibility of more than one "*". Do you > need this? It might present some troublsome ambiguities for the replace > side fo the equation. > > Regular expressions would of course, provide the most general solution! :) And the most difficult to code in C. I've never seen C regular expression code. I'll have to look some up sometime. Either way, that's not the route I'm taking. > > In any case I tried to think of a counter-example - something that wouldn't > work in this approach, but I only came up with another situation that DOES > work, which I'll mention anyway. Suppose some company hosts all mail > domains as subdomains under their company domain name. So in this case the > non-wildcard-based logindomainlist would look something like this: > > domain1.org:domain1.org.thewebmailcompany.com > domain2.com:domain2.com.thewebmailcompany.com > > In this case the wildcard approach would look like this: > > *:*.thewebmailcompany.com > > which works fine! Great! If you can't think of any problems, and I can't think of any problems, then it might actually be a decent idea! I'm going to try to code it tonight. My boss is pushing me to finish this nonsense up! > > -Kurt Bigler > > > Thanks! > > > > Jesse > > > >> /jesse -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net We are actively looking for companies that do a lot of long distance faxing and want to cut their long distance bill by up to 50%. Contact [EMAIL PROTECTED] for more info.
