cancel
Showing results for 
Search instead for 
Did you mean: 

forward mail.

Jeffrey F. Goldsmith
Super Advisor

forward mail.

I have HP-UX 11.0 and at one point I was having mail forwarded to my computer but it hasn't worked for a couple of months. It's not that I haven't noticed that I wasn't getting any mail but we just haven't been using this server until this past month.
Now everyone wants to know why they aren't getting any mail.

I have checked their file - /usr/mail
and put their e-mail address into their file-
- Foward to user@address

I also want root to foward all of it's mail to my computer so I went to /home/root and vi the .forward file and put my e-mail into the file.

When I send a mail message to root, it doesn't show up at my computer. What could I be doing wrong?

Thanks for any help you can give.
22 REPLIES
Michael Tully
Honored Contributor

Re: forward mail.

Hi Jeff,

Make sure that none of the directories in
the filesystem have directory permissions
of 777. They must bet set to 755 or higher.

e.g.


HTH
-Michael
Anyone for a Mutiny ?
Joseph C. Denman
Honored Contributor

Re: forward mail.

Things you might check:

make sure sendmail is running

check /var/adm/syslog/mail.log file for errors

Can you send mail out from the command line???


...jcd...
If I had only read the instructions first??
Uday_S_Ankolekar
Honored Contributor

Re: forward mail.

Hi,

Check /var/adm/syslog/mail.log for possible problem.

If sendmail is not running start it by /sbin/init.d/sendmail start

Make sure that home directory for root is /home/root

If sendmail is running and configured correctly then .forward file should forward all the mails, but mail.log give you more clear picture about what's happening..
-Goodluck,
-USA..
Good Luck..
Jeffrey F. Goldsmith
Super Advisor

Re: forward mail.

I went to /var/adm/syslog/mail.log and found this message at the end of the log. Is this any help?

Dec 12 12:56:06 diomede sendmail[2134]: MAA02134: MAB02134: return to sender: Ho
st unknown (Name server: co.fairbanks.ak.us: host not found)
Dec 12 12:56:06 diomede sendmail[2134]: MAB02134: to=ssmith@co.fairbanks.ak.us,j
goldsmith@co.fairbanks.ak.us, delay=00:00:00, xdelay=00:00:00, mailer=smtp, rela
y=co.fairbanks.ak.us, stat=Host unknown (Name server: co.fairbanks.ak.us: host n
ot found)
Rob Galloway_1
Frequent Advisor

Re: forward mail.

first check to see if sendmail is running
'ps -ef | grep sendmail'
Then test to see if it can send mail to you using

/usr/sbin/sendmail -v your.email@your.domain
Test
Message
^D

This will give you a verbose output which will indicate where problems lie if there are any.
Experience is a hard teacher. It tests first and teaches afterward.
Rob Galloway_1
Frequent Advisor

Re: forward mail.

Check to ensure resolv.conf , nsswitch.conf and /etc/hosts are all configured correctly to allow hostname resolution.
Experience is a hard teacher. It tests first and teaches afterward.
Michael Tully
Honored Contributor

Re: forward mail.

Sounds like the system cannot see your
mail server from DNS. Suggest you
compare the DNS and sendmail setup to
another system.

/etc/resolv/conf
/etc/nsswitch.conf
/etc/mail/sendmail.cw

Anyone for a Mutiny ?
Jeffrey F. Goldsmith
Super Advisor

Re: forward mail.

I couldn't find this file /etc/resolv/conf

I checked my other server and it had this file but the file is empty.

The following is what I get when I try to send mail to myself:

root: /etc ==> /usr/sbin/sendmail -v jgoldsmith@co.fairbanks.ak.us
Test
Message
jgoldsmith@co.fairbanks.ak.us... Connecting to co.fairbanks.ak.us via smtp...
jgoldsmith@co.fairbanks.ak.us... Host unknown (Name server: co.fairbanks.ak.us: host not found)
root... WARNING: writable directory /home/root
root... WARNING: writable directory /home/root
/home/root/.forward: line 1: forwarding to ssmith@co.fairbanks.ak.us
/home/root/.forward: line 2: forwarding to jgoldsmith@co.fairbanks.ak.us
/home/root/dead.letter... cannot open: Permission denied
ssmith@co.fairbanks.ak.us,jgoldsmith@co.fairbanks.ak.us... Host unknown (Name server: co.fairbanks.
ak.us: host not found)
MAILER-DAEMON... aliased to root
root... WARNING: writable directory /home/root
root... WARNING: writable directory /home/root
/home/root/.forward: line 1: forwarding to ssmith@co.fairbanks.ak.us
/home/root/.forward: line 2: forwarding to jgoldsmith@co.fairbanks.ak.us
postmaster... aliased to root
root... WARNING: writable directory /home/root
root... WARNING: writable directory /home/root
/home/root/.forward: line 1: forwarding to ssmith@co.fairbanks.ak.us
/home/root/.forward: line 2: forwarding to jgoldsmith@co.fairbanks.ak.us
ssmith@co.fairbanks.ak.us,jgoldsmith@co.fairbanks.ak.us... Host unknown (Name server: co.fairbanks.
ak.us: host not found)
MAILER-DAEMON... aliased to root
root... WARNING: writable directory /home/root
root... WARNING: writable directory /home/root
/home/root/.forward: line 1: forwarding to ssmith@co.fairbanks.ak.us
/home/root/.forward: line 2: forwarding to jgoldsmith@co.fairbanks.ak.us
MAILER-DAEMON... Saved message in /var/tmp/dead.letter

Rob Galloway_1
Frequent Advisor

Re: forward mail.

The file you are looking for is resolv.conf .
resolv/conf is a typo.
Experience is a hard teacher. It tests first and teaches afterward.
Rob Galloway_1
Frequent Advisor

Re: forward mail.

I would personally be checking to ensure /etc/resolv.conf isn't configured with a domain where a nameserver host should be.

I probably should look something like

domain co.fairbanks.ak.us
nameserver
nameserver

This i just a guess I hope it helps
Experience is a hard teacher. It tests first and teaches afterward.
Rob Galloway_1
Frequent Advisor

Re: forward mail.

Correction sorry,

If your domain is fairbanks.ak.us it should read

domain fairbanks.ak.us

R.
Experience is a hard teacher. It tests first and teaches afterward.
Jeffrey F. Goldsmith
Super Advisor

Re: forward mail.

I did not have a /etc/resolv.conf file so I created one with this information:

domain co.fairbanks.ak.us
nameserver 172.16.0.41
nameserver 209.165.150.166

Is this going to work for me?
Rob Galloway_1
Frequent Advisor

Re: forward mail.

Is your domain 'fairbanks.ak.us' or 'co.fairbanks.ak.us'?

If is 'co.fairbanks.ak.us' and the IP addresses are those of your dns and
/etc/nsswitch.conf is configured to resolve using dns then you should be right to go.



Experience is a hard teacher. It tests first and teaches afterward.
Jeffrey F. Goldsmith
Super Advisor

Re: forward mail.

Here is my /etc/nsswitch.conf

root: /etc ==> more /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any name services.
#
hosts: files
services: files
protocols: files
networks: files
rpc: files
netgroup: files
automount: files

aliases: files
passwd: files
group: files
publickey: files
Rob Galloway_1
Frequent Advisor

Re: forward mail.

Jeff,

This server seems not to have ever been set up for DNS .

To set this server up to look for hosts in its local /etc/hosts file and then your DNS change the line

hosts: files

to read

something like

hosts: files [NOTFOUND=continue TRYAGAIN=continue] dns

Make sure you are keeping copies of your old files.
R.
Experience is a hard teacher. It tests first and teaches afterward.
Rob Galloway_1
Frequent Advisor

Re: forward mail.

Jeff,

Just as a matter of interest what is your local hostname?

R.
Experience is a hard teacher. It tests first and teaches afterward.
Joseph C. Denman
Honored Contributor

Re: forward mail.

Jeff,

Sorry....I had to leave out of the office. The problems is as stated above, DNS. You have a resolution issue. Modify your /etc/resolv.conf and /etc/nsswitch.conf as stated above. You should be good to go.

To test use nslookup.


Let us know!!!

...jcd...
If I had only read the instructions first??
Jeffrey F. Goldsmith
Super Advisor

Re: forward mail.

Rob,

My host name is diomede.

I ran nslookup and it gave me the reply;
Using /etc/hosts on: diomede

so it looks like that is working.
Joseph C. Denman
Honored Contributor

Re: forward mail.

You have a resolution problem. The error indicates it can not find co.fairbanks.ak.us . Can you resolve that with nslookup? I bet not. When you can resolve that host, your mail should work.

...jcd...
If I had only read the instructions first??
Rob Galloway_1
Frequent Advisor

Re: forward mail.

Jeff,

Sorry about the slow response had to go home for the night. I have only just logged back in.

Can you clarify a point for me.

What is the hostname of the machine you are trying to forward mail to?
I am guessing at 'co' but I want to be sure that that is not part of your domain name?

As per the question above can you do a nslookup to this host.

R.
Experience is a hard teacher. It tests first and teaches afterward.
Jeffrey F. Goldsmith
Super Advisor

Re: forward mail.

this is what I get when I run nslookup.
My server name is diomede and the ip is 172.16.0.1
My domain name is co.fairbanks.ak.us
The addresses that I was given for DNS are 172.16.0.41 and 209.165.150.166

root: /etc ==> nslookup diomede
*** Can't find server name for address 172.16.0.41: Non-existent domain
*** Can't find server name for address 209.165.150.166: Timed out
*** Default servers are not available
Using /etc/hosts on: diomede

looking up FILES
Name: diomede
Address: 172.16.0.1
Aliases: diomede
Steven Sim Kok Leong
Honored Contributor

Re: forward mail.

Hi,

Your forwarding system is 172.16.0.1 which is a private IP. Have your routers in your network been configured in the first place to route traffic from a private IP address (eg. NAT) to the public network?

Can you perform a ping to the mail server you are trying to forward your mail to? If ping is blocked at your firewall, try the following to troubleshoot:

# telnet mail_server_ip 25

See if it gets connected successfully.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Email: steven@beepz.com. Homepage: https://www.beepz.com