Re: [sqwebmail] default domain

2003-08-27 Thread Trevor Astrope
On Wed, 27 Aug 2003, Tanmaya Anand wrote:

 hi
 
 I want that user should only type his user name,  he should be logged in.
 For example, [EMAIL PROTECTED] , when opens mail.abc.com/cgi-bin/sqwebmail
  or abc.con/cgi-bin/sqwebmail, he should only supply his username user1 
  not complete [EMAIL PROTECTED]

This is how I did it. Using the logindomainlist was not an option for me,
since I have 5000 virtual domains already configured with unique
usernames, so having them all listed in logindomainlist was not practical
and seems like a spammer's honeypot to me. Also, I needed pop to use the
same authentication method, so it wasn't practical to force 5000 users to
change their email configurations to include the domain in their pop
configurations.

What I did was to use an sql database, in my case postgresql, since we already 
use postgresql extensively and have a dedicated postgresql server. In 
order to accomplish this, I had to use a custom query. The id field 
contains the unique username, but the query returns a field I called 
'email' which contains the [EMAIL PROTECTED] form of the email address.

Using unique usernames in the id field should be enough, but the problem
is if the id field only contains a username and no @domain, sqwebmail will
append the server's hostname or the value of
/usr/local/share/sqwebmail/hostname to the username to form the email
address.

I had to also define the DEFAULT_DOMAIN in authpgsqlrc, because the custom 
query requires that a domain name be sent to sqwebmail or it won't attempt 
the query. So, I just used example.com, but I never use the $(domain) 
variable. It is just there to make sqwebmail happy.

Here is an example query...Mine does some joins with some existing 
customer tables, but this is enough to get it working:

PGSQL_SELECT_CLAUSE SELECT email, crypt, '', uid, gid, \
   home, maildir, '', name \
FROM passwd \
WHERE id = '$(local_part)'

Just adjust it to your own configuration.

I also compiled courier-imap with 
--with-authdaemonvar=/usr/local/share/sqwebmail/var/authdaemon so pop3d 
and sqwebmail share the same authdaemon. Now, if pop3d could use the same 
sqwebmail cache as well, that would be fantastic, but this doesn't seem 
possible, as courier-imap doesn't use a cache.

One other thing I do is send  a hangup signal to the authdaemon every hour 
to prevent the persistent db connections from timing out, as we use a 
stateful firewall between the webmail server and our database server. I 
added this line to the /etc/cron.hourly/sqwebmail-cron-cleancache script:

kill -HUP `cat /usr/local/share/sqwebmail/var/authdaemon/pid`

It's not pretty, but it works.

I hope this helps someone else.

Trevor




Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Jesse Guardiani
On Friday 21 February 2003 11:55, Dale wrote:
 I am trying to figure out if there is a way to have
 the login automatically send a default domain for
 domain based templates.
 ie: www.domian1.com when using that webmail the login
 name automatically sends [EMAIL PROTECTED]

 and user using thisdomain.com when logs in
 automatically sends [EMAIL PROTECTED] without having
 to enter the thisdomain.com or domain1.com

If you're using Vpopmail, then you can set the VPOPMAIL_DOMAIN
variable from Apache on a per-domain basis. (This is a relatively
undocumented Vpopmail feature)

Also, below is a excerpt from the INSTALL doc in the root of
the distribution:

--
/usr/local/share/sqwebmail/logindomainlist  - if this file exists then
   the login screens will include a drop-down list whose contents will be
   read  from  this  file.  This  file  should  contain  a list of E-mail
   domains,  one  per  line. It should be created if SqWebMail is used to
   provide   mail   access   for  multiple  domains.  Instead  of  typing
   [EMAIL PROTECTED]  to  log  in, it will only be necessary to enter user,
   and select the domain from the drop-down list.
--

Finally, I am currently working on coding functionality for and IP to domain
lookup file that will be used by sqwebmail to automatically derive the
domain from the IP address of the CGI host. This will facilitate what you
need, I believe, but it's not ready yet, and I'm not sure when it will be.

Good luck.

Jesse




 =
 oo

   | The only possible interpretation of any   |
   | research whatever in the social sciences  |
   | is: some do, some don't.|
   |
   |  -Ernest Rutherford   |

   oo

 __
 Do you Yahoo!?
 Yahoo! Tax Center - forms, calculators, tips, more
 http://taxes.yahoo.com/

-- 
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.





Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Kurt Bigler
on 2/21/03 8:55 AM, Dale [EMAIL PROTECTED] wrote:

 I am trying to figure out if there is a way to have
 the login automatically send a default domain for
 domain based templates.
 ie: www.domian1.com when using that webmail the login
 name automatically sends [EMAIL PROTECTED]
 
 and user using thisdomain.com when logs in
 automatically sends [EMAIL PROTECTED] without having
 to enter the thisdomain.com or domain1.com

I have worked out a solution _related_ to what you are asking about.  The
solution involves a change to the sqwebmail source.  I am planning on
researching how to make this change as general-purpose as possible and
submitting it as a change to sqebmail.  Since you asked this question, I
will go ahead an start this research now, and will appreciate anyone's
input.  Meanwhile what I write here may help you solve your problem right
away, if I have not misunderstood what you are asking.

I do not have per-domain templates.  However, for each mail domain I have
a distinct webmail domain of the form webmail.domain.

The sqwebmail website domain is available to sqwebmail through the HTTP_HOST
environment variable.

I am currently making this work in combination with the logindomainlist
feature, wherein the file /usr/local/share/sqwebmail/logindomainlist
(perhaps path may vary) triggers the presence of a popup list of domains for
the user to chose from when logging in.  There are other ways to do this,
however this approach will suffice as an example.  I wanted to arrange that
the popup list of domains would default to a domain that matches the one
obtained from the HTTP_HOST environment variable.  This required only a few
lines to be added to sqwebmail/sqwebmail.c.  However, the code I use
currently depends on the webmail. convention that I use, wherein I have a
webmail subdomain for each domain that supports webmail access.

I would like to solicit input on how to make this more general, possibly
also supporting a situation in which the popup domain list is not involved.
With per-domain templates, this could be accomplished via a hidden field in
the template which specifies the mail login domain to be used.  However, I
would also like to chose an approach which does not depend on a per-domain
set of templates.

It occurs to me that an easy solution might be to set a WEBMAIL_LOGIN_DOMAIN
environment variable per apache virtual domain.  I actually haven't
investigated how this is done in apache yet - I have heard it is possible,
but have not even confirmed this.


So to summarize the possibilities, there are two aspects to the problem:


1.  How to determine the mail login domain, or (if applicable) the default
mail login domain.  There are 3 possibilities I can think of:

* to infer it from the HTTP_HOST environment variable, by some matching
process

* to get it directly from a per-domain WEBMAIL_LOGIN_DOMAIN environment
variable

* to allow it to be specified as a hidden field in the template

One or more of these possibilities could be supported, but of course I don't
want to add undue complexity, so if any one of these represents a good
general solution then that is the one to use, I think.


2.  In the case of the first two possibilities above, there would be various
options:

* to use the mail login domain obtained as described as the default for the
logindomainlist popup

* to use it directly - not as a default - allowing the user no choice of
mail domain

* to use it to set a separate editable-text domain field, which I believe
does not curently exist


I can send in a patch for what I have currently done, if anyone is
interested, but I need to come back to that later.


-Kurt Bigler








Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Jesse Guardiani
On Friday 21 February 2003 13:58, Kurt Bigler wrote:
 on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 11:55, Dale wrote:

snip


 I would appreciate it if you could comment on whether your solution based
 on IP etc will make it unnecessary to do what I was suggesting in my
 original response to this thread.  Although I currently use vpopmail, I
 would prefer a solution that does not depend on vpopmail.  I would
 definitely like the solution to be able to provide a _default_ rather than
 a fixed domain, so that other domains can be typed or selected from a popup
 if desired.

As I mentioned in the original post, vpopmail users can set the VPOPMAIL_DOMAIN
environment variable from apache to facilitate transparent domain hard-coding per
host. However, this method only applies to vpopmail users, and doesn't allow for
a default as you mention above.

The method I am working on (mostly in my head right now) will consist of a comma
or colon delimited flat file, with one IP:DOMAIN pair per line, as in the example
below:

IP1:DOMAIN1
IP2:DOMAIN2
etc...

I will read the IP from the SERVER_ADDR CGI environment variable (set by apache),
and compare this IP to the flat file above.

I _COULD_ just do a reverse DNS lookup, but this would be undesirable, since not
every domain has proper reverse DNS available. And it's restrictive. I dislike
restrictive programming.

I think I can implement the next step in a two part conditional:

1.) If the user is using the 'logindomainlist' file, we will simply default the
list to the DOMAIN field of the matching IP:DOMAIN record in the IP lookup
flat file.

2.) If the user isn't using the 'logindomainlist' file, we will create a
'logindomain' hidden field on the login.html page with a value of DOMAIN
from the IP lookup flat file.

All of this will make IP-DOMAIN lookups usable for non vpopmail users. A number
of improvements can be made in the future, such as CDB lookups and such, but this
is beyond the scope of what I'd like to implement in the near future.

I'd also like to FIX vpopmail IP-alias domain capability in sqwebmail at the same
time. Vpopmail _SHOULD_ be capable of automatic IP-aliasing (if enabled in vpopmail
source and with 'vipmap') by only setting the TCPLOCALIP environment variable
equal to SERVER_ADDR in the auth module, but I can't get it to fly.

More debugging I guess.

Anyway, that's basically what I plan to do. Shouldn't be too hard to implement.

What do you think Sam? Sound decent? 

I have some time today, and hopefully over the weekend, to code. I've already
promised my users that I'll get IP-alias functionality working within a month
(two weeks ago), so I'm pretty commited to getting this done soon.

Any thoughts/input would be welcome.

Jesse



 Thanks,
 Kurt Bigler

-- 
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.





Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Kurt Bigler
on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:

 On Friday 21 February 2003 13:58, Kurt Bigler wrote:
 on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 11:55, Dale wrote:
 
 snip
 
 
 I would appreciate it if you could comment on whether your solution based
 on IP etc will make it unnecessary to do what I was suggesting in my
 original response to this thread.  Although I currently use vpopmail, I
 would prefer a solution that does not depend on vpopmail.  I would
 definitely like the solution to be able to provide a _default_ rather than
 a fixed domain, so that other domains can be typed or selected from a popup
 if desired.
 
 As I mentioned in the original post, vpopmail users can set the
 VPOPMAIL_DOMAIN
 environment variable from apache to facilitate transparent domain hard-coding
 per
 host. However, this method only applies to vpopmail users, and doesn't allow
 for
 a default as you mention above.
 
 The method I am working on (mostly in my head right now) will consist of a
 comma
 or colon delimited flat file, with one IP:DOMAIN pair per line, as in the
 example
 below:
 
 IP1:DOMAIN1
 IP2:DOMAIN2
 etc...
 
 I will read the IP from the SERVER_ADDR CGI environment variable (set by
 apache),
 and compare this IP to the flat file above.

My server is set up to do name-based virtual hosting, and so I haven't had
experience with anything else.  My server has only one IP address.  Does
what you are suggesting apply to this situation?  Perhaps you are solving a
problem at an entirely different level from the one I was trying to solve.

So to clarify, what I would envision as a alternative to what you were
suggesting, but which would solve the problem I need to solve, would be a
similar table:

webmail-http-domain-1:email-login-domain-1
webmail-http-domain-2:email-login-domain-2
etc.

Where the first field is the HTTP_HOST value and the second field is the
associated login domain.

This is because I do not want to assume that it will always look like this:

webmail.somedomain1.com:somedomain1.com
webmail.somedomain2.com:somedomain2.com
webmail.somedomain3.com:somedomain3.com

For example somedomain4 might be in another language, in which the term
webmail would not apply.  So I do need such a lookup list.  It could be
that the logindomain list can contain an optional colon followed by the
HTTP_HOST value, just reversing the fields above, possibly followed by a 3rd
field specifying whether a popup list should be presented for that
HTTP_HOST.  This avoids having to maintain yet another list of domains, but
I think gives the full desired functionality.  I suspect this idea might
apply to your IP-based mapping, even though I don't understand that yet.

In any case, the config file idea is probably easier to use than setting an
environment variable per apache virtual domains.  Rolling it into the
existing logindomainlist without requiring a popup would be icing on the
cake.

How does this relate to what you are doing?

-Kurt Bigler

 
 I _COULD_ just do a reverse DNS lookup, but this would be undesirable, since
 not
 every domain has proper reverse DNS available. And it's restrictive. I dislike
 restrictive programming.
 
 I think I can implement the next step in a two part conditional:
 
 1.) If the user is using the 'logindomainlist' file, we will simply default
 the
 list to the DOMAIN field of the matching IP:DOMAIN record in the IP lookup
 flat file.
 
 2.) If the user isn't using the 'logindomainlist' file, we will create a
 'logindomain' hidden field on the login.html page with a value of DOMAIN
 from the IP lookup flat file.
 
 All of this will make IP-DOMAIN lookups usable for non vpopmail users. A
 number
 of improvements can be made in the future, such as CDB lookups and such, but
 this
 is beyond the scope of what I'd like to implement in the near future.
 
 I'd also like to FIX vpopmail IP-alias domain capability in sqwebmail at the
 same
 time. Vpopmail _SHOULD_ be capable of automatic IP-aliasing (if enabled in
 vpopmail
 source and with 'vipmap') by only setting the TCPLOCALIP environment variable
 equal to SERVER_ADDR in the auth module, but I can't get it to fly.
 
 More debugging I guess.
 
 Anyway, that's basically what I plan to do. Shouldn't be too hard to
 implement.
 
 What do you think Sam? Sound decent?
 
 I have some time today, and hopefully over the weekend, to code. I've already
 promised my users that I'll get IP-alias functionality working within a month
 (two weeks ago), so I'm pretty commited to getting this done soon.
 
 Any thoughts/input would be welcome.
 
 Jesse
 
 
 
 Thanks,
 Kurt Bigler




Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Jesse Guardiani
On Friday 21 February 2003 15:26, Kurt Bigler wrote:
 on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 13:58, Kurt Bigler wrote:
  on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 11:55, Dale wrote:
 
  snip
 
  I would appreciate it if you could comment on whether your solution
  based on IP etc will make it unnecessary to do what I was suggesting in
  my original response to this thread.  Although I currently use vpopmail,
  I would prefer a solution that does not depend on vpopmail.  I would
  definitely like the solution to be able to provide a _default_ rather
  than a fixed domain, so that other domains can be typed or selected from
  a popup if desired.
 
  As I mentioned in the original post, vpopmail users can set the
  VPOPMAIL_DOMAIN
  environment variable from apache to facilitate transparent domain
  hard-coding per
  host. However, this method only applies to vpopmail users, and doesn't
  allow for
  a default as you mention above.
 
  The method I am working on (mostly in my head right now) will consist of
  a comma
  or colon delimited flat file, with one IP:DOMAIN pair per line, as in the
  example
  below:
 
  IP1:DOMAIN1
  IP2:DOMAIN2
  etc...
 
  I will read the IP from the SERVER_ADDR CGI environment variable (set by
  apache),
  and compare this IP to the flat file above.

 My server is set up to do name-based virtual hosting, and so I haven't had
 experience with anything else.  My server has only one IP address.  Does
 what you are suggesting apply to this situation?  Perhaps you are solving a
 problem at an entirely different level from the one I was trying to solve.

 So to clarify, what I would envision as a alternative to what you were
 suggesting, but which would solve the problem I need to solve, would be a
 similar table:

 webmail-http-domain-1:email-login-domain-1
 webmail-http-domain-2:email-login-domain-2
 etc.

 Where the first field is the HTTP_HOST value and the second field is the
 associated login domain.

 This is because I do not want to assume that it will always look like this:

 webmail.somedomain1.com:somedomain1.com
 webmail.somedomain2.com:somedomain2.com
 webmail.somedomain3.com:somedomain3.com

 For example somedomain4 might be in another language, in which the term
 webmail would not apply.  So I do need such a lookup list.  It could be
 that the logindomain list can contain an optional colon followed by the
 HTTP_HOST value, just reversing the fields above, possibly followed by a
 3rd field specifying whether a popup list should be presented for that
 HTTP_HOST.  This avoids having to maintain yet another list of domains, but
 I think gives the full desired functionality.  I suspect this idea might
 apply to your IP-based mapping, even though I don't understand that yet.

 In any case, the config file idea is probably easier to use than setting an
 environment variable per apache virtual domains.  Rolling it into the
 existing logindomainlist without requiring a popup would be icing on the
 cake.

 How does this relate to what you are doing?

It doesn't. My solution will only be applicable to IP based domains.

Can you currently log into IMAP or POP3 on your domain without specifying
[EMAIL PROTECTED] as the userid? 

If you CAN, then I will try to figure out what vpopmail is doing to facilitate
this functionality. If you CAN'T, then I don't think it will be unreasonable
of me to implement this solution for IP based domains only.

You could implement a string matching operation as you mentioned above. But
I don't run virtual DNS domains, so I wouldn't be the person to code it.

I'd be happy to discuss implementation issue with you though. :) 

Jesse



 -Kurt Bigler

  I _COULD_ just do a reverse DNS lookup, but this would be undesirable,
  since not
  every domain has proper reverse DNS available. And it's restrictive. I
  dislike restrictive programming.
 
  I think I can implement the next step in a two part conditional:
 
  1.) If the user is using the 'logindomainlist' file, we will simply
  default the
  list to the DOMAIN field of the matching IP:DOMAIN record in the IP
  lookup flat file.
 
  2.) If the user isn't using the 'logindomainlist' file, we will create a
  'logindomain' hidden field on the login.html page with a value of DOMAIN
  from the IP lookup flat file.
 
  All of this will make IP-DOMAIN lookups usable for non vpopmail users. A
  number
  of improvements can be made in the future, such as CDB lookups and such,
  but this
  is beyond the scope of what I'd like to implement in the near future.
 
  I'd also like to FIX vpopmail IP-alias domain capability in sqwebmail at
  the same
  time. Vpopmail _SHOULD_ be capable of automatic IP-aliasing (if enabled
  in vpopmail
  source and with 'vipmap') by only setting the TCPLOCALIP environment
  variable equal to SERVER_ADDR in the auth module, but I can't get it to
  fly.
 
  More debugging I guess.
 
  

Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Kurt Bigler
on 2/21/03 12:44 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:

 On Friday 21 February 2003 15:26, Kurt Bigler wrote:
 on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 13:58, Kurt Bigler wrote:
 on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 11:55, Dale wrote:
[snip]
 The method I am working on (mostly in my head right now) will consist of
 a comma
 or colon delimited flat file, with one IP:DOMAIN pair per line, as in the
 example
 below:
 
 IP1:DOMAIN1
 IP2:DOMAIN2
 etc...

[snip]

 My server is set up to do name-based virtual hosting, and so I haven't had
 experience with anything else.  My server has only one IP address.  Does
 what you are suggesting apply to this situation?  Perhaps you are solving a
 problem at an entirely different level from the one I was trying to solve.
 
 So to clarify, what I would envision as a alternative to what you were
 suggesting, but which would solve the problem I need to solve, would be a
 similar table:
 
 webmail-http-domain-1:email-login-domain-1
 webmail-http-domain-2:email-login-domain-2
 etc.
 
 Where the first field is the HTTP_HOST value and the second field is the
 associated login domain.
 
 This is because I do not want to assume that it will always look like this:
 
 webmail.somedomain1.com:somedomain1.com
 webmail.somedomain2.com:somedomain2.com
 webmail.somedomain3.com:somedomain3.com

[snip]

 How does this relate to what you are doing?
 
 It doesn't. My solution will only be applicable to IP based domains.
 
 Can you currently log into IMAP or POP3 on your domain without specifying
 [EMAIL PROTECTED] as the userid?

Absolutely, but of course it is not a login to IMAP or POP3 but into a
Maildir, whose contents could have been put there by any means.

So yes, I started by using the logindomainlist feature, so right away
entering [EMAIL PROTECTED] was not necessary, but I still had to select the domain
from the popup list.  But then I changed sqwebmail.c so that it would set a
default value for the popup list by recognizing the list item that matched
HTTP_HOST with webmail. prepended.  As I said, not a general solution yet.

But in any case, it is good that you are working on the _correponding_
problem, but for IP-based rather than name-based hosting.  Because I'm
almost sure all the external configuration issues will be analogous.  In
fact I suspect the implementation will also be analogous, i.e. that the same
files will be touched in roughtly the same places to solve both problems.

I suspect that the same configuration file could specify either a name or an
ip, and accordingly you would match it against either SERVER_ADDR or
HTTP_HOST.  Once you do a lookup in either case you are determining a login
domain NAME, so the rest of the implementation should be identical.

Can I get you to buy into the idea that this can all be done using
logindomainlist?  Use records of one of two formats:

logindomain:http_host:popup_flag
logindomain:server_addr:popup_flag

Perhaps name and ip-based virtual hosting can't coexist on the same server
(can it?), in which case what I am proposing here is overly general solution
with redundant information, i.e. every record basically specifies whether
name or ip-based hosting is being used.  But still perhaps this is ok.  I
think it is friendly for the administrator in either case.

If I'm right then you could trivially include the name-hosting solution when
you code what you are working on.  I will be glad to test it and work on it
as needed, but we might as well do both things at once if at all possible.
Only problem may be that our schedules won't coincide and the process will
take more time.  But 9 chances out of 10 your solution will just work for
the name-based situation if you just keep in mind HTTP_HOST as well as
SERVER_ADDR.  But if you want to code yours first and pass it to me, that is
also fine.  If I'm not missing something big here, I can turn it around
fairly quickly.

Let me know.  I'll be around on and off this afternoon, until 5 or 6 pacific
time.

-Kurt Bigler

 If you CAN, then I will try to figure out what vpopmail is doing to facilitate
 this functionality. If you CAN'T, then I don't think it will be unreasonable
 of me to implement this solution for IP based domains only.
 
 You could implement a string matching operation as you mentioned above. But
 I don't run virtual DNS domains, so I wouldn't be the person to code it.
 
 I'd be happy to discuss implementation issue with you though. :)
 
 Jesse






Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Jesse Guardiani
On Friday 21 February 2003 16:22, Kurt Bigler wrote:
 on 2/21/03 12:44 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 15:26, Kurt Bigler wrote:
  on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 13:58, Kurt Bigler wrote:
  on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 11:55, Dale wrote:


snippety snip snip

  Can you currently log into IMAP or POP3 on your domain without specifying
  [EMAIL PROTECTED] as the userid?

 Absolutely, but of course it is not a login to IMAP or POP3 but into a
 Maildir, whose contents could have been put there by any means.

So, you've never used POP3 or IMAP? Just sqwebmail?


 So yes, I started by using the logindomainlist feature, so right away
 entering [EMAIL PROTECTED] was not necessary, but I still had to select the
 domain from the popup list.  But then I changed sqwebmail.c so that it
 would set a default value for the popup list by recognizing the list item
 that matched HTTP_HOST with webmail. prepended.  As I said, not a general
 solution yet.


snip

 I suspect that the same configuration file could specify either a name or
 an ip, and accordingly you would match it against either SERVER_ADDR or
 HTTP_HOST.  Once you do a lookup in either case you are determining a login
 domain NAME, so the rest of the implementation should be identical.

Hmmm. That's not a bad idea. I don't remember real clearly what the HTTP_HOST
variable looks like, but I could easily do a comparison against both variables.

Good idea!


 Can I get you to buy into the idea that this can all be done using
 logindomainlist?  Use records of one of two formats:

 logindomain:http_host:popup_flag
 logindomain:server_addr:popup_flag

No. I want to keep the two files separate for compatibility reasons, as well
as functionality reasons. I like the idea of defaulting the domain drop down
on the login page if the 'logindomainlist' file exists. I think that would
be a bit harder to implement if I overload the 'logindomainlist' file for this
new functionality.


 Perhaps name and ip-based virtual hosting can't coexist on the same server
 (can it?),

Don't know first hand, but I don't see why not. 

 in which case what I am proposing here is overly general
 solution with redundant information, i.e. every record basically specifies
 whether name or ip-based hosting is being used.  But still perhaps this is
 ok.  I think it is friendly for the administrator in either case.

 If I'm right then you could trivially include the name-hosting solution
 when you code what you are working on.  I will be glad to test it and work
 on it as needed, but we might as well do both things at once if at all
 possible. Only problem may be that our schedules won't coincide and the
 process will take more time.  But 9 chances out of 10 your solution will
 just work for the name-based situation if you just keep in mind HTTP_HOST
 as well as SERVER_ADDR.

Agreed. I'll have to make sure that the HTTP_HOST variable actually contains
the data we want, and that there isn't a better variable choice out there,
but I don't see why it wouldn't work as expected.


  But if you want to code yours first and pass it to
 me, that is also fine.  If I'm not missing something big here, I can turn
 it around fairly quickly.

Once I get mine working, I can wait as long as it takes to confirm that your
side works before we submit it to Mr. Sam. Once my users are happy, the pressure
is off. :)


 Let me know.  I'll be around on and off this afternoon, until 5 or 6
 pacific time.

I'll try to get something working this weekend. No promises though. I've got
to keep the wife and kid happy too on the weekends. :)



 -Kurt Bigler

-- 
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.





Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Kurt Bigler
on 2/21/03 1:56 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:

 On Friday 21 February 2003 16:22, Kurt Bigler wrote:
 on 2/21/03 12:44 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 15:26, Kurt Bigler wrote:
 on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 13:58, Kurt Bigler wrote:
 on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 11:55, Dale wrote:
 
 
 snippety snip snip
 
 Can you currently log into IMAP or POP3 on your domain without specifying
 [EMAIL PROTECTED] as the userid?
 
 Absolutely, but of course it is not a login to IMAP or POP3 but into a
 Maildir, whose contents could have been put there by any means.
 
 So, you've never used POP3 or IMAP? Just sqwebmail?

No, I was just clarifying in case there was some feature of sqwebmail that I
didn't know about for acting as a POP3 or IMAP client.  I also know there
are POP3/IMAP clients that will serve into Maildir's - and I want to find
one of those.  Actually it would be great to integrate hotmail-like POP3
access for multiple accounts into a single webmail login.  Has anyone
managed to do that?  (Potential new thread here.)
 
 So yes, I started by using the logindomainlist feature, so right away
 entering [EMAIL PROTECTED] was not necessary, but I still had to select the
 domain from the popup list.  But then I changed sqwebmail.c so that it
 would set a default value for the popup list by recognizing the list item
 that matched HTTP_HOST with webmail. prepended.  As I said, not a general
 solution yet.
 
 
 snip
 
 I suspect that the same configuration file could specify either a name or
 an ip, and accordingly you would match it against either SERVER_ADDR or
 HTTP_HOST.  Once you do a lookup in either case you are determining a login
 domain NAME, so the rest of the implementation should be identical.
 
 Hmmm. That's not a bad idea. I don't remember real clearly what the HTTP_HOST
 variable looks like, but I could easily do a comparison against both
 variables.
 
 Good idea!
 
 
 Can I get you to buy into the idea that this can all be done using
 logindomainlist?  Use records of one of two formats:
 
 logindomain:http_host:popup_flag
 logindomain:server_addr:popup_flag
 
 No. I want to keep the two files separate for compatibility reasons, as well
 as functionality reasons. I like the idea of defaulting the domain drop down
 on the login page if the 'logindomainlist' file exists. I think that would
 be a bit harder to implement if I overload the 'logindomainlist' file for this
 new functionality.

I think it might not be harder - might actually be the easiest way.  (Sent
you some details off-list.)


-Kurt Bigler




Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Jesse Guardiani
On Friday 21 February 2003 17:06, Kurt Bigler wrote:
 on 2/21/03 1:56 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 16:22, Kurt Bigler wrote:
  on 2/21/03 12:44 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 15:26, Kurt Bigler wrote:
  on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 13:58, Kurt Bigler wrote:
  on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 11:55, Dale wrote:
 

snip


 No, I was just clarifying in case there was some feature of sqwebmail that
 I didn't know about for acting as a POP3 or IMAP client.  I also know there
 are POP3/IMAP clients that will serve into Maildir's - and I want to find
 one of those.  Actually it would be great to integrate hotmail-like POP3
 access for multiple accounts into a single webmail login.  Has anyone
 managed to do that?  (Potential new thread here.)

Ok. I'm confused. Let me ask these questions individually:

1.) Do you have a WORKING IMAP or POP3 server installed on the machine in question?

2.) If the answer to question 1 above was 'yes', then do you have to log in
with [EMAIL PROTECTED], or can you log in with just 'user', while accessing a
port on 'domain'? ('yes' for '[EMAIL PROTECTED]' only. 'no' for logins with
just 'user' on a port at 'domain')

3.) Are you using vpopmail to authenticate these IMAP or POP3 accounts?

4.) What is your IMAP/POP3 server type? (Courier-IMAP, Washington IMAP, etc...)

Thanks!

Jesse



snip


 -Kurt Bigler

-- 
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.





Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Kurt Bigler
on 2/21/03 2:14 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:

 On Friday 21 February 2003 17:06, Kurt Bigler wrote:
 on 2/21/03 1:56 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 16:22, Kurt Bigler wrote:
 on 2/21/03 12:44 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 15:26, Kurt Bigler wrote:
 on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 13:58, Kurt Bigler wrote:
 on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 11:55, Dale wrote:
 
 
 snip
 
 
 No, I was just clarifying in case there was some feature of sqwebmail that
 I didn't know about for acting as a POP3 or IMAP client.  I also know there
 are POP3/IMAP clients that will serve into Maildir's - and I want to find
 one of those.  Actually it would be great to integrate hotmail-like POP3
 access for multiple accounts into a single webmail login.  Has anyone
 managed to do that?  (Potential new thread here.)
 
 Ok. I'm confused. Let me ask these questions individually:

Sorry I just added to the confusion.  I was thinking that SqWebMail was a
Maildir client not involving POP3/IMAP, but I had forgotten about the
login authorization issue (duh).

 
 1.) Do you have a WORKING IMAP or POP3 server installed on the machine in
 question?

Yes, qmail+vpopmail.  No IMAP currently.
 
 2.) If the answer to question 1 above was 'yes', then do you have to log in
 with [EMAIL PROTECTED], or can you log in with just 'user', while accessing a
 port on 'domain'? ('yes' for '[EMAIL PROTECTED]' only. 'no' for logins with
 just 'user' on a port at 'domain')

Yes, I login as just user, because the logindomainlist popup is present and
already defaulted to the correct domain due to my changes to sqwebmail.c.
 
 3.) Are you using vpopmail to authenticate these IMAP or POP3 accounts?

Yes.
 
 4.) What is your IMAP/POP3 server type? (Courier-IMAP, Washington IMAP,
 etc...)

I have nothing else besides qmail and vpopmail.  I actually can't remember
off hand which half of qmail+vpopmail actually runs the POP3 server, but I
have a totally standard configuration in that regard.

-Kurt Bigler




Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Jesse Guardiani
On Friday 21 February 2003 17:35, Kurt Bigler wrote:
 on 2/21/03 2:14 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 17:06, Kurt Bigler wrote:
  on 2/21/03 1:56 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 16:22, Kurt Bigler wrote:
  on 2/21/03 12:44 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 15:26, Kurt Bigler wrote:
  on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 13:58, Kurt Bigler wrote:
  on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 11:55, Dale wrote:
 

snip


  1.) Do you have a WORKING IMAP or POP3 server installed on the machine in
  question?

 Yes, qmail+vpopmail.  No IMAP currently.

  2.) If the answer to question 1 above was 'yes', then do you have to log
  in with [EMAIL PROTECTED], or can you log in with just 'user', while accessing
  a port on 'domain'? ('yes' for '[EMAIL PROTECTED]' only. 'no' for logins with
  just 'user' on a port at 'domain')

 Yes, I login as just user, because the logindomainlist popup is present and
 already defaulted to the correct domain due to my changes to sqwebmail.c.

But what about POP3?? That's the whole point of these questions. Can you log in
as just 'user' with POP3?

Thanks.



  3.) Are you using vpopmail to authenticate these IMAP or POP3 accounts?

 Yes.

  4.) What is your IMAP/POP3 server type? (Courier-IMAP, Washington IMAP,
  etc...)

 I have nothing else besides qmail and vpopmail.  I actually can't remember
 off hand which half of qmail+vpopmail actually runs the POP3 server, but I
 have a totally standard configuration in that regard.

 -Kurt Bigler

-- 
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.





Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Kurt Bigler
on 2/21/03 2:53 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:

 On Friday 21 February 2003 17:35, Kurt Bigler wrote:
 on 2/21/03 2:14 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 1.) Do you have a WORKING IMAP or POP3 server installed on the machine in
 question?
 
 Yes, qmail+vpopmail.  No IMAP currently.
 
 2.) If the answer to question 1 above was 'yes', then do you have to log
 in with [EMAIL PROTECTED], or can you log in with just 'user', while accessing
 a port on 'domain'? ('yes' for '[EMAIL PROTECTED]' only. 'no' for logins with
 just 'user' on a port at 'domain')
 
 Yes, I login as just user, because the logindomainlist popup is present and
 already defaulted to the correct domain due to my changes to sqwebmail.c.
 
 But what about POP3?? That's the whole point of these questions. Can you log
 in
 as just 'user' with POP3?

Certainly not.  I have a lot of domains, and user names are not unique
across them.  But just to be sure I just tried it, and no it did not work.

Just for your reference, my SqWebMail config options as shown in config.log
are:

  $ ./configure --enable-webpass=vpopmail --without-authuserdb
--without-authpam --without-authpwd --without-authshadow --without-authldap
--with-authvchkpw --enable-imageurl=/images --enable-hardtimeout=10
--enable-softtimeout=10
--enable-imagedir=/usr/local/apache/htdocs/webmail/images
--enable-cgibindir=/usr/local/apache/cgi-bin --with-ispell=/usr/bin/ispell
--without-authdaemon

-Kurt Bigler





Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Kurt Bigler
on 2/21/03 1:56 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:

 On Friday 21 February 2003 16:22, Kurt Bigler wrote:
 on 2/21/03 12:44 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 15:26, Kurt Bigler wrote:
 on 2/21/03 11:33 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 13:58, Kurt Bigler wrote:
 on 2/21/03 10:07 AM, Jesse Guardiani [EMAIL PROTECTED] wrote:
 On Friday 21 February 2003 11:55, Dale wrote:
 
 
[snip]

 If I'm right then you could trivially include the name-hosting solution
 when you code what you are working on.  I will be glad to test it and work
 on it as needed, but we might as well do both things at once if at all
 possible. Only problem may be that our schedules won't coincide and the
 process will take more time.  But 9 chances out of 10 your solution will
 just work for the name-based situation if you just keep in mind HTTP_HOST
 as well as SERVER_ADDR.
 
 Agreed. I'll have to make sure that the HTTP_HOST variable actually contains
 the data we want, and that there isn't a better variable choice out there,
 but I don't see why it wouldn't work as expected.


Besides HTTP_HOST there is also SERVER_NAME, which _sounds_ more analogous
to SERVER_ADDR.  In my test cases HTTP_HOST is the same as SERVER_NAME.
However O'Reilly CGI Programming in Perl has these descriptions:

SERVER_NAME The server's hostname or IP address.

HTTP_HOST   The hostname of the server from the requested URL
(this corresponds to teh HTTP 1.1 Host field).

So HTTP_HOST is probably the way to go.  It is just the host part of the
url, i.e no http:, no initial //, no file path or query string.

A couple years back I ran a predecessor of this idea past Sam (not on the
list) and he didn't balk at using HTTP_HOST, although I don't know that he
thought deeply about it.


-Kurt Bigler






Re: [sqwebmail] default domain with domain templates

2003-02-21 Thread Jesse Guardiani
On Friday 21 February 2003 18:28, Kurt Bigler wrote:
 on 2/21/03 2:53 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  On Friday 21 February 2003 17:35, Kurt Bigler wrote:
  on 2/21/03 2:14 PM, Jesse Guardiani [EMAIL PROTECTED] wrote:
  1.) Do you have a WORKING IMAP or POP3 server installed on the machine
  in question?
 
  Yes, qmail+vpopmail.  No IMAP currently.
 
  2.) If the answer to question 1 above was 'yes', then do you have to
  log in with [EMAIL PROTECTED], or can you log in with just 'user', while
  accessing a port on 'domain'? ('yes' for '[EMAIL PROTECTED]' only. 'no' for
  logins with just 'user' on a port at 'domain')
 
  Yes, I login as just user, because the logindomainlist popup is present
  and already defaulted to the correct domain due to my changes to
  sqwebmail.c.
 
  But what about POP3?? That's the whole point of these questions. Can you
  log in
  as just 'user' with POP3?

 Certainly not.  I have a lot of domains, and user names are not unique
 across them.  But just to be sure I just tried it, and no it did not work.

 Just for your reference, my SqWebMail config options as shown in config.log
 are:

   $ ./configure --enable-webpass=vpopmail --without-authuserdb
 --without-authpam --without-authpwd --without-authshadow --without-authldap
 --with-authvchkpw --enable-imageurl=/images --enable-hardtimeout=10
 --enable-softtimeout=10
 --enable-imagedir=/usr/local/apache/htdocs/webmail/images
 --enable-cgibindir=/usr/local/apache/cgi-bin --with-ispell=/usr/bin/ispell
 --without-authdaemon

 -Kurt Bigler

OK. I'm done. It works.

I'll try to clean up my source code (lots of debug stuff) and send the list a
patch tommorrow.

It's pretty simple, and it should work with your virtual DNS domains too, but I
haven't tried it.

Time to go home!

-- 
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.