On Fri, 2003-03-28 at 13:35, Szabo Nandor wrote:
> > "The other way to implement virtual domains is by using a custom
> > authentication back-end, such as LDAP or MySQL". I'm using the MySQL
> > authentication back end. 
> > 
> > What I don't understand is that when one of these users logs into
> > SqWebmail, they become [EMAIL PROTECTED], and not [EMAIL PROTECTED] as they have
> > entered at the SqWebmail login prompt. This affects their from address
> > when composing an email. Does this mean that the FAQ entry is wrong? Or
> > is there some more configuration to do to make this work with SqWebmail?
> > I have a system that delivers all the email just fine, it's just getting
> > SqWebmail to recognise the person's domain that is the problem (they
> > authenticate just fine). 
> > 
> > Any tips?
> 
> That this problem is occur, then user type uid at sqwebmail prompt, not the 
> full e-mail address. 
> 
> In my LDAP environment, I gave my DEFAULT_DOMAIN in authldaprc, so I can 
> login by typing just uid.
> and
> Put a file named "hostname" to  sqwebmail directory (/usr/local/sqwebmail), 
> contaning the DEFAULT_DOAMAIN. 
> 
> I think, with MYSQL it is similar.
> It is documented in "Runtime configuration" section. 
> 
> Nandor Szabo 


Thanks very much for taking the time to reply. You are correct, there is
a default domain name in the authmysqlrc configuration file. But setting
this does not affect how the user is reported at the top right of the
SqWebmail screen and in the From field when you compose a new email. In
both these cases, you get [EMAIL PROTECTED] It seems that the default
domain gets discarded and is only used during the authentication SQL.

This can be semi-cured by creating a hostname file in the same place as
authmysqlrc and putting the default domain in there as well, but then
this only works for people of one domain, hardly a virtual domain
solution. I'm not sure why there is this separation between domain and
hostname, and why, both seem to need to be set for things to work (and
for only one domain).

The fix, for anyone interested, it to change the code. I've only just
done this 5 minutes ago, and so it needs more testing, but if you go to
where the source code is, and go into the authlib directory, edit the
authmysql.c file and on line 80 (ish), you'll see a call to a function
called "authsuccess". The 5th parameter is "authinfo->username" which is
just the username. Remove "authinfo->username" and replace it with
"authdata". Authdata is a parameter given to the function you are
looking at and is basically (from what i can tell), what the user writes
in the login box in SqWebmail. This means that if they just type "user"
into the login box, then the whole default domain/hostname thing comes
in to play, but now with my change, if they type [EMAIL PROTECTED], it will
actually do something with the domain part rather than just throw it
away for no good reason.

Like I say, this has only been done a few minutes ago so there may be
bugs to work out but at the moment, SqWebmail correctly reports
[EMAIL PROTECTED] in both the top right of the screen, and in the From box
when composing an email.

Whilst we are talking about the From box for composing email, does
anyone else think it's a bit strange that this is actually an editable
field in the default template? Surely this is a security risk? Or Does
SqWebmail actually ignore any changes the user might make and use what
it put there originally anyway? I've not had time to experiment with
this yet but I will do. Just seemed a strange decision.

Regards,
Andrew




Reply via email to