NIS/YP domainname used for default email address



MailNews: Account Configuration
18 years ago
14 years ago


(Reporter: Andrew Taylor, Assigned: (not reading, please use instead))


Firefox Tracking Flags

(Not tracked)



(1 attachment)



18 years ago
In the New E-Mail Account Setup wizard, the e-mail address field is autofilled
with <username>@<domainname>.  However, on unix systems the domainname used is
the YP/NIS domainname, which may not be set for systems not using YP/NIS.  The
YP/NIS domainname is also not necessarily related to the e-mail address.

Currently, xpfe/appshell/src/nsUserInfoUnix.cpp is calling uname to obtain the
domainname.  It is probably more appropriate to use the DNS domainname, which
can be obtained by calling gethostbyname(2) on the result of gethostname(2).
sspitzer owns that file, it seems - or does most work on it. CCing him.

Seth - what do you think?


Comment 2

18 years ago
Created attachment 13248 [details] [diff] [review]
Patch to get domain name from DNS lookup rather than NIS/YP domain name

Comment 3

18 years ago
I've been meaning to comment in this for a while.
the domainname you get back from uname() is the correct domainname. if your site 
has configured this to be the same as your NIS domain name, your machine is 
misconfigured. uname() is not aware of NIS domains, it just so happens that some 
linux configurations default the system's domainname to the NIS domainname

I have a machine at Netscape where the system's dommainname is, but 
our NIS domainname is I'm pretty sure this service defaults the 
domainname to not

cc'ing ninoschka to see if she can confirm this (I don't have access to a Linux 
box right now)
to confirm:
- type uname -n to confirm that your hostname ends in
- start mozilla and create a mail account. confirm that the default e-mail 
address ends in

Comment 4

18 years ago
Mozilla currently uses two results from the call to uname.  First it checks
utsname.domainname (or __domainname).  This value is the value set by
setdomainname (as documented in setdomainname(2)).  It is also the value
returned by domainname(1), which is documented in the man page as being "the
systems NIS/YP domain name".  This may be a Linuxism.

Second, utsname.nodename is checked.  This is the value returned by uname -n,
and is set in /etc/HOSTNAME on RedHat Linux.  This will typically be the fully
qualified domainname, but i've seen it set to just the hostname.

On the particular configuration I tested on, the domainname wasn't set
(__domainname was blank) and the node name was set to the short hostname.  In
this particular (mis-)configuration, calling gethostname/gethostbyname works,
and the others don't.

Note that on all Solaris boxes I've seen, utsname.domainname and
utsname.__domainname don't exist, so it always falls back on the node name.

Finally, its worth noting that the gethostname/gethostbyname also works on
Win32, so it could be added to nsUserInfoWin.cpp, where GetDomain is stubbed.

Comment 5

18 years ago
Build 2000-08-17-09M18: Linux 6.0

- I ran "uname -n" and it reports ''
- Created a new profile, opened Mai, the Wizard opens, Other ISP or email
provider is selected, select Next and the Identity panel shows ''

Comment 6

18 years ago
so is this bug Invalid?

Comment 7

18 years ago
Are we still seeing this bug in the latest daily builds?
taking this from alecf, since it is an account manager bug.
Ever confirmed: true

Comment 9

18 years ago
I can't test this, the email address is no longer filled in in the account
Depends on: 59379

Comment 10

18 years ago
*** Bug 59379 has been marked as a duplicate of this bug. ***

Comment 11

18 years ago
actually giving to sspitzer, since he claimed to take it above :)
Assignee: alecf → sspitzer

Comment 12

18 years ago
Ignore my comment above.  The account wizard works -- it just doesn't fill in
the email address if it doesn't find a domain name or a node name with a dot in
marking WONTFIX based on comments above (comment 6, comment 9, comment 12).
Last Resolved: 14 years ago
Resolution: --- → WONTFIX

Comment 14

14 years ago
On a typical Fedora Core 2 install not using NIS, uname returns __domainname =
"(none)" and nodename = "".  The current code will use
"username@(none)" instead of  I think it would make more sense
to use nodename before __domainname (I suspect NIS is used in a minority of
systems and nodename will be equally valid), or at least ignore a domainname of
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.