Operating System - HP-UX
1834200 Members
3109 Online
110066 Solutions
New Discussion

Re: mailx does not work from root

 
Nisar Ahmad
Regular Advisor

mailx does not work from root

Hi There

mailx does work from my own account but not from root.

Thanks

Nisar
7 REPLIES 7
Mic V.
Esteemed Contributor

Re: mailx does not work from root

More specifics would help. If I were able to talk to you interactively, here's what I'd ask:
- What command lines have you tried?
- What do you mean by "does not work" --
you can't read mail, mail you send bounces
back, mail you send goes into a black hole,
...?
- what is your mail environment? Do you have
a "smart relay/smart host" at your site,
etc.

Sorry to bombard you with questions, just
trying to help.

Mic
What kind of a name is 'Wolverine'?
B Unix
New Member

Re: mailx does not work from root

Hi M

Thanks for the prompt response.

Actually it does not reach to a general email. Yes we have a smtprelay server that is why it is working from my own account.

Nisar
Mic V.
Esteemed Contributor

Re: mailx does not work from root

So what you're saying is that from the same host, if you log in as you and:

echo foo | mailx -s from-me myaddr@aol.com

or

echo foo | mailx -s from-me mylocaladdr

it works, but if you do the same exact thing as root, it doesn't work?

Assuming that what I wrote is accurate, I assume you've tried sending mail to a variety of addresses or examined root's .mailrc/.forward?

Try sending a mail as root (like you've been doing), then immediately do this:

tail /var/adm/syslog/mail.log

(or whereever your mail log is). Assuming it's actually getting sent off the system, it should tell you what happened to it (though it can be a bit cryptic). Please post your command line and what the log showed, if you don't mind.

Also, look at /var/mail/root (or wherever your spool is) to see if it's bouncing.

It's a long shot since some mail is working, but you can also try something like:

/usr/lib/sendmail -bt

> 3 mylocaladdr

I'm doing this from memory, I may be a little off. Good luck.

Mic

What kind of a name is 'Wolverine'?
Mark Greene_1
Honored Contributor

Re: mailx does not work from root


Review your /etc/sendmail.cf file to see if it has been setup to redirect root's mail, in addition to checking the mail log to see if it is being sent in the first place.

mailq -v -d will tell you if messages are getting hung in the queue.

mark
the future will be a lot like now, only later
Steven E. Protter
Exalted Contributor

Re: mailx does not work from root

diagnostic:

as root

sendmail -v -d8.99 -d38.99 someaddress@somedomain.com

type some text

.



I'm thinking there could be a problem in /etc/mail/access or /etc/mail/aliases that's misdirecting the mail.

This diagnostic will help you figure it out.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geno Church_1
Valued Contributor

Re: mailx does not work from root

Nisar,

Check the sendmail.cf file to be sure that the following line is
commented out:

# CE root (insert "#" sign to comment out)

Next, stop/start sendmail, then send a test email from root account.

Let us know how it goes :)

Geno
Geno Church_1
Valued Contributor

Re: mailx does not work from root

Nisar,

Also in this file, make sure there is not more than one of those entries. All instances need to be commented out.

Geno