Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'sendmail sending mail...how to receive?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
sendmail sending mail...how to receive?
Authored by: ppmax on Aug 13, '01 12:56:29PM

thanks adriaan--

here are the lines from etc/hostconfig:
++++++++++++++++++++++
HOSTNAME=-<MYDOMAIN.COM>- <--my domain is registered and working; i host a website
ROUTER=-AUTOMATIC- <--should i set this to the IP address of my router??
++++++++++++++++++++++

it seems like im fighting a OS X bug: when i use mail ("mail user@mac.com") upon receiving it i can check the header and it reveals the mail is from "user@localhost"...so the domain name i set above isnt being found. since my OS X box is behind a firewall (my router) do i have to set up a DNS server to resolve my internal IP address (192.168.0.xx)? here's a snip from my mail.log:
++++++++++++++++++++++
Aug 13 03:16:02 localhost sendmail[7515]: My unqualified host name (localhost) unknown; sleeping for retry
Aug 13 03:17:02 localhost sendmail[7515]: unable to qualify my own domain name (localhost) -- using short name
Aug 13 03:17:03 localhost sendmail[7516]: My unqualified host name (localhost) unknown; sleeping for retry
Aug 13 03:18:03 localhost sendmail[7516]: unable to qualify my own domain name (localhost) -- using short name
+++++++++++++++++++++
further, my terminal prompt still says "[localhost:~] ~user" i can "su root" and "hostname -s MYDOMAIN.COM" but this will only last for the duration of my login--it doesnt get set permanently.

any help would be appreciated!

thx



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: dsauve on Aug 15, '01 04:45:29PM

I was having the same error in the mail log:

> Aug 12 03:16:02 localhost sendmail[348]: unable to qualify my own domain name (localhost) -- using short name

In /Library/Documentation/Administration/Services/sendmail/README under "HOST NAME SERVICES" it says to use this form in /etc/hosts:

> 128.32.149.68 mastodon.CS.Berkeley.EDU mastodon

I'm not getting that particular error anymore.

damon






[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: ppmax on Aug 15, '01 05:03:18PM

thanks daemon--

i read this a while ago, but decided not to alter my /etc/hosts file because the header in that file tells you not to:

# Note that this file is consulted when the system is running in single-user
# mode. At other times this information is handled by lookupd. By default,
# lookupd gets information from NetInfo, so this file will not be consulted
# unless you have changed lookupd's configuration.

i dont run single user mode, so i just assumed that something had to change in NetInfo. Last nite i added another value to my /machines entry, but to no avail..

i appreciate the help--pls keep it coming

ppmax



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: dsauve on Aug 16, '01 10:34:32AM

MacFixit's front page discusses hopw to set both NetInfo and hosts file. I'll include it all here. Also, check out the post preceeding it which gives a more detailed explanation of how to set-up NetInfo:

http://www.macfixit.com/archivesx/august.01.b.x.shtml#ipnames-08-14

damon


- - -

Giving local machines names rather than IP addresses:
A follow-up

Regarding yesterday's item on assigning local names to local addresses:

Joseph Bruni adds:

* You don't have to restart the netinfo domains for changes to take effect. All changes are dynamic.
* If the machines you create in the machines section are not running OS X, you should remove the 'serves' property. The only two properties you need are name and ip_address.

Corby Tobin describes another method entirely, which "sets the hostname on the Unix end and in NetInfo":

1. Open Terminal.app.
2. Type: sudo hostname -s <machinename>.
3. Edit the file </etc/hostconfig>. You can do this via Terminal, using the pico editior (i.e., type: sudo pico /etc/hostconfig) or by opening up an Aqua text editor, such as TextEdit, with root privileges (e.g., type: sudo open <path for TextEdit.app>
4. Where the text "HOSTNAME=-AUTOMATIC-" appears, replace "-AUTOMATIC-"
with whatever name you want (no spaces, of course).
5. Save changes and quit.
6. Open up NetInfo Manager.app. Click the lock icon to unlock the app so you can edit settings.
7. The second window pane will have the things that can be set for /. Click on "machines" and in the third pane click on "localhost."
8. In the bottom pane, click on the hierarchial arrow to show all items for localhost.
9. Click on the localhost listed within that. From the Directory menu, select New Value.
10. Type in the machinename you want and hit return, then drag it so it's above localhost.
11. Select "Save" from the Domain menu, confirm the update and quit.
12. On the next restart the machinename will be whatever you set.



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: ppmax on Aug 16, '01 01:21:25PM

thanks for the pointers...but one of those tips doesnt work. try this yourself:

in the terminal type hostname -s <machinename>
quit termainal...open up a new session. the machine name is set. now restart. this info is lost.

also, ive edited the /etc/hostname file....

but after i made the changes to netinfo, i tested sending mail and it now appears that my domain is being appended correctly. messages now come from user@MYDOMIAN.COM but the problem still remains: whenever i reply to this address it bounces. do i have to create users/aliases in sendmail?

thx agian



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: dsauve on Aug 16, '01 02:23:54PM

I think we have similar network setups. I have a mac on a router behind DSL modem. The router is set to listen to port 25. I have sendmail working, but I haven't yet set my website's MX record to point to my static ip address, so I can send mail from my mac, but I can't reply back to it (actually, my MX records are still pointing to my ISP's mail server, so I can get mail, just not through my server). My first question, then, are your MX records pointing to your static ip?



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: ppmax on Aug 16, '01 04:17:48PM

FYI: i now have everything working. the key was that apparently sendmail looks to the /etc/hostconfig file for info about the hostname of the machine. because my machine is on an internal LAN, i entered "dualg4.mydomain.com" for the hostname. to further confuse matters, i had previously followed a tip for netinfo to add a value for the /machines record so that my internal IP address would resolve to my machine name. thus dualg4 = 192.168.0.110

anyways, the key (provided you have changed you MX records accordingly) is to set your hostname in /etc/hostconfig to your fully qualified domain name. my sendmail now sends and receives mail from my domain. cool! (was a bit easier to config with webstar...)

another slighly confusing issue is where hostname -s is written. if you open a terminal and set this (hostname -s MYDOMAIN.COM) it will reset to localhost once you reboot your machine.

lastly, its a bit odd to me that netinfo and the unix underwear dont share the same info. if they do it certainly doesnt seem like it, considering my recent troubles getting this stuff to work.

any netinfo geeks out there?

thx again for everyone's help



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: robh on Aug 16, '01 04:52:29PM

> anyways, the key (provided you have changed you MX records accordingly) is to set your hostname in
> /etc/hostconfig to your fully qualified domain name. my sendmail now sends and receives mail from
> my domain. cool! (was a bit easier to config with webstar...)

I don't use a domain name in mine..

% grep ^HOST /etc/hostconfig
HOSTNAME=chad

OSX doesn't seem to care what my domain is.

I use /etc/mail/local-host-names to tell sendmail what domain names I use for email.



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: ppmax on Aug 17, '01 01:07:52AM

thanks robh...

anyways, care to post your /etc/mail/local-host-names? im really having a hard time understanding how the heck domain names and host names are stored, passed around and resolved. here's a list of stuff ive done. all i know is that all my servers are working...finally.

1. i changed /etc/hostconfig to HOSTNAME=-MYDOMAIN.COM-
2. i never changed the ROUTER=-AUTOMATIC- <--looks like i should change this to my router address
3. i added another names property to / machines localhost. now it reads:
ip_address 127.0.0.1
name (MYDOMAIN.COM, localhost)
serves ./local
4 i duplicated this record and renamed it dualg4
ip_address 192.168.0.110 <--my internal ip address
name (dualg4)
serves ./local
5. ive tried setting the hostname -s in the terminal...this just reverts to localhost upon restart


any comments?

thanks



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: robh on Aug 17, '01 05:03:02AM

>anyways, care to post your /etc/mail/local-host-names?

basically it contains parts that appear on the right hand side of an '@' in an email address, so if I receive mail for 'rob@foo.bar.com' and 'another@xyz.net', then /etc/mail/local-hosts-names would contain:

foo.bar.com
xyz.net

AFAIK, this tells sendmail to deliver mail for these two domains to users on this machine, and not to try to find another machine (locally or on the net) that will accept the mail.

> im really having a hard time understanding
> how the heck domain names and host names are stored, passed around and resolved.

I don't think how those work is relevant to setting up sendmail as such. To change the behaviour of name resolving for email purposes, you need to look into 'MX' records for your domain, and chances are that it's your ISP that controls this and they probably offer no way for you to change this. If you've bought your own domain name then you probably do have control of your MX records, in which case you need to configure this via whatever service your domain name provider offers - that provider must have a place where you can give it the IP address of your machine (e.g. for www access) and it may also ask you for an IP address of your mail server.

Say you owned myname.com and have a single computer at home.
Run 'nslookup' (no flags)
Type myname.com at the '>' prompt, and you'll be told the IP address of your machine
Type "set querytype=MX"
Type "myname.com" again
You'll now be shown where email for myname.com gets sent.
Unless that matches your home computer, sendmail on that machine won't directly receive email sent to @myname.com

If you've been collecting email via POP (or similar) from an ISP then it's 90% likely that your mail will stay on your ISPs mailserver and not get delivered to your osx box. My ISP lets me collect via POP or receive the email via SMTP, so I can run sendmail and when I dial in, sendmail starts to receive new email that's been stored by my ISP. Check to see if your ISP offers SMTP delivery, if it does then you need to enable it to use sendmail. but make sure sendmail is working properly before switching on SMTP delivery.

I've heard that some ISPs will block the email port to prevent people running their own SMTP server.

Also note that having your own mail server can open you up to abuse from spammers. If you mess up the configuration, your email can also bounce without you noticing.

> here's a list of
>stuff ive done. all i know is that all my servers are working...finally.

>2. i never changed the ROUTER=-AUTOMATIC- <--looks like i should change this to my router address

Your networking obviously works, so don't change that setting. It's nothing to do with sendmail. Sorry if my mentioning it confused.

>5. ive tried setting the hostname -s in the terminal...this just reverts to localhost upon restart

don't bother using 'hostname'. It doesn't make a permanent change that survives reboots.



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: dsauve on Aug 17, '01 04:07:46PM

Thanks for helping me get sendmail working. I did everything that was suggested, and the final piece was waiting for DNS to update my domain name to my new IP number.

I'm sending and receiving!

Now if I could just get my SSH to work between machines....

damon



[ Reply to This | # ]
sendmail sending mail...how to receive?
Authored by: robh on Aug 16, '01 04:36:19PM

I've been using sendmail for both incoming and outgoing email for months now.

From what I've seen, sendmail uses the email aliases setup by NetInfo. Anything in /etc/mail/aliases is ignored. You can import an existing aliases file into NetInfo with "niload aliases ."

For the record, my /etc/hostcofig has these:

HOSTNAME=chad
ROUTER=10.1.2.1
MAILSERVER=-YES-

(if you're a newbie, DON'T copy "chad" - my machine name, or "10.1.2.1" - my LAN router IP)

I have an /etc/mail/local-host-names file that tells sendmail the names of the domains that I use AND OWN, and an /etc/mail/relay-domains containing the same domains - this is to stop spammers using my machine to relay their spam to any other domain.

I also have an /etc/mail/sendmail.cf, but I don't remember if it came with OSX or if I copied it there from my old FreeBSD box.
% wc sendmail.cf
1214 5788 35103 sendmail.cf
I know I didn't need to alter the sendmail.cf

I hope that helps someone.



[ Reply to This | # ]