Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Domain structure

Quote Reply
Domain structure
What would be the best way to have the user's address domain be the site they appear to be on while logged in?

i.e. The popular setup is to have them log into any domain available from thisdomain.com, and even if their address is joe@thatdomain.com the url is going to be thisdomain.com in the address bar.

That make sense? Is there a way to make it look like people are logged into the site that reflects their address without having multiple instances of GM?

If it's relative, mine are set up as virtual servers on the same box, but I still want it to appear as if they're on different domains. Would it have something to do with httpd.conf? I'd like to be able to keep /index.html's on each domain different. Thanks in advance!

Quote Reply
Re: Domain structure In reply to
I had a similar question, and Alex gave one possible solution to it in this thread:

http://www.gossamer-threads.com/perl/forum/showflat.pl?Cat=&Board=GMDisc&Number=148811&page=2&view=collapsed&sb=5

I'm not sure about redirecting users to a new url though.

Cheers,
Regan.


Quote Reply
Re: [ryel01] Domain structure In reply to
here's what I'm thinking and testing out now... which I think is what Winchell was asking...

I want to see the name of the domain they are using in the address/location window of the browser and only let them sign up for email for that domain when using it and also force the template selection (ie, no choices) so I can brand the domain...

In GMail.pm in sub domain_select right before this line
return ($select, $match);
I have added the following code
$select = $ENV{SERVER_NAME};
$select =~ s/^www.//gi;
$select =~ s/^mail.//gi;

now I have the main part of the domain as domain.com

I added the same thing in sub template right before this line
return \$select;

and also in sub template_set right before this line
return $t;
I added this
$t = $ENV{SERVER_NAME};
$t =~ s/^www.//gi;
$t =~ s/^mail.//gi;

now I am forcing my template and domain select to whatever.com that they are on and they won't have any select pulldowns to select other domains from.

Now for the templates. What I'm planning on doing is creating a new subdirectory for the templates called domain1.com and domain2.com with copies of the default templates edited for branding on that domain.

And for being able to really run the url through, just simply alias each domain you want to brand to the main domain it's installed on and now you can type in whatever domain you want, and the above steps take care of all the forcing of domains and templates to match the server name they typed in.

It seems to be okay so far, but I still have a bunch of testing to do.

Anyone have any thoughts on doing things this way.

Last edited by:

JerryP: Sep 13, 2001, 1:04 PM
Quote Reply
Re: [winchell] Domain structure In reply to
Hi,

It's going to mean setting up your webserver. For instance, you want to map domain1.com/mail and domain2.com/mail to the same directory. Since Gossamer Mail use relative paths (i.e. all the links are just webmail.cgi) it's fine from there. You can see this on our site at:

http://freemail.gossamer-threads.com
http://mywebmail.gossamer-threads.com

The second part is having the select lists default properly. This can be done with a simlpe global:

custom_domain =>
Code:
sub {
my $tags = shift;
if (! $IN->param('domain')) { $IN->param('domain', $ENV{SERVER_NAME}); }
return GMail::domain();
}
What that does is set domain = the domain you are on if you haven't already got one set.

Then you just replace <%GMail::domain%> with <%custom_domain%> in your templates and you are safe for upgrades.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Domain structure In reply to
Hi

I'm having trouble mapping the domains to the same directory.

I have set up the domains.

domain1.com/mail
domain2.com/mail

In apache I go to the virtual server.
Then Aliases and Redirects.
And enter in document directory aliases.

from = /mail
to = /home/web/domain1.com/cgi-bin/mail/user/

This doesn't seem to work.
I'm using webmin.

Thanks in advance.

Dregs2


Quote Reply
Re: [dregs2] Domain structure In reply to
Hi,

What happens? Do you get a file not found error? If so, what do the error logs say?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [dregs2] Domain structure In reply to
Solved it.

After you save the changes you need to apply the changes. Doh!!!

Dregs2
Linux newbie:)
Quote Reply
Re: [dregs2] Domain structure In reply to
Ok

Now it transfers correctly when i call up mydomain.com/mail.
But it just displays as text the login.cgi script.

The path is /home/web/mydomain.com/cgi-bin/mail/user/login.cgi

Getting there

Dregs2
Quote Reply
Re: [dregs2] Domain structure In reply to
So close now.

I changed the alises to

From = /cgi-bin/
To = /var/www/html/mydomain.com/cgi-bin/mail/user

I then call otherdomain/cgi-bin/login.cgi

This all works great.

When I then try to use the global and replace <%GMail::domains%> with <%custom_domain%> it just prints the sub on the login page.

Any ideas

Dregs2
Quote Reply
Re: [dregs2] Domain structure In reply to
Hi,

Make sure you have no leading white space. It must start with 'sub {' or it won't think it's a function.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Domain structure In reply to
I've tried lots of different ways and it still prints it.
The code is below.

sub { my $tags = shift; if (! $IN->param('domain')) { $IN->param('domain', $ENV{SERVER_NAME}); } return GMail::domain();}

I'm sure its something obivious :)

Dregs2
Quote Reply
Re: [dregs2] Domain structure In reply to
Hi,

What version of Gossamer Mail are you using?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Domain structure In reply to
Version 2.06

Installed last week by you guys.

Dregs2
Quote Reply
Re: [dregs2] Domain structure In reply to
Hi,

Very strange. Can you send an email to support-gmail@gossamer-threads.com with admin info and I'll take a look?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Domain structure In reply to
Hi

The solution to this is the following global

sub {
my $tags = shift;
return \qq~<input type="hidden" name="domain" value="$ENV{SERVER_NAME}"> $ENV{SERVER_NAME}~;
}

Thanks to Alex for the solution

Dregs2