Operating System - HP-UX
1837523 Members
3722 Online
110117 Solutions
New Discussion

Re: mailx problem (Uegent)

 
SOLVED
Go to solution
prasadb
Super Advisor

mailx problem (Uegent)

hello experts,

i am facing some problem on my HP Ux box..
the machine send the mail from the root only, but from any other normal user when the mail is sent,
they get this error..

$ echo "hello" | mailx -s "test" xyz@xyz.com
$ mail: can't send to xyz@xyz.com
Mail saved in dead.letter

But when i tried same from the root, it was sent without any problem..

please help (its urgent)

thanking you in advance !!

WR,
prasad
26 REPLIES 26
prasadb
Super Advisor

Re: mailx problem (Uegent)

and i think sendmail runs only by the root ..
any othere option ?
Aneesh Mohan
Honored Contributor

Re: mailx problem (Uegent)

Hi Prasad,

Can you post the o/p of

$sendmail -v -d8.99 -d38.99 abc@yahoo.com


Aneesh
Fabio Ettore
Honored Contributor

Re: mailx problem (Uegent)

Hi,

check also the file /var/adm/syslog/mail.log which usually contains more info about mail service.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Dennis Handly
Acclaimed Contributor

Re: mailx problem (Uegent)

>But when i tried same from the root, it was sent without any problem.

Do you have a directory permission problem?
What is the permissions/owner of sendmail? (PHNE_35951)
-r-sr-sr-t 1 root mail 2561608 Jun 18 2007 /usr/sbin/sendmail
prasadb
Super Advisor

Re: mailx problem (Uegent)

hello Aneesh,
so you are there today too :-)
happy diwali to you..

well, here is the o/p of

# sendmail -v -d8.99 -d38.99 abc@yahoo.com
;; res_querydomain(dlmds03, ideaconnect.com, 1, 1)
;; res_query(dlmds03.ideaconnect.com, 1, 1)
;; Querying server (# 1) address = 10.4.0.17
seq_map_parse(aliases.files, )
;; res_query(8.21.4.10.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 10.4.0.17
;; res_querydomain(dlmds03.ideaconnect.com., , 1, 1)
;; res_query(dlmds03.ideaconnect.com, 1, 1)
;; Querying server (# 1) address = 10.4.0.17
map_init(sequence:aliases.files, NULL, 0)
sequence:aliases.files NULL: valid
map_init(implicit:Alias0, /etc/mail/aliases, 0)
wrong pass (pass = 0, rebuildable = 1)
map_init(host:host, NULL, 0)
host:host NULL: valid
map_init(switch:aliases, aliases, 0)
switch_map_open(aliases, aliases, 0)
switch_map_find => 1
files
map_stack[0] = sequence:aliases.files
switch:aliases aliases: valid
map_init(dequote:dequote, NULL, 0)
dequote:dequote NULL: valid
map_init(host:resolve, NULL, 0)
host:resolve NULL: valid
map_init(sequence:aliases.files, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(implicit:Alias0, /etc/mail/aliases, 1)
impl_map_open(Alias0, /etc/mail/aliases, 0)
hash_map_open(Alias0, /etc/mail/aliases, 0)
impl_map_lookup(Alias0, @)
db_map_lookup(Alias0, @)
implicit:Alias0 /etc/mail/aliases: valid
map_init(host:host, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(switch:aliases, aliases, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(dequote:dequote, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
map_init(host:resolve, NULL, 1)
wrong pass (pass = 1, rebuildable = 0)
getcanonname(yahoo.com), trying dns
dns_getcanonname(yahoo.com, trymx=1)
dns_getcanonname: trying yahoo.com. (ANY)
;; res_querydomain(yahoo.com, , 1, 255)
;; res_query(yahoo.com., 1, 255)
;; Querying server (# 1) address = 10.4.0.17
YES
dns_getcanonname: yahoo.com
getcanonname(yahoo.com), found

prasadb
Super Advisor

Re: mailx problem (Uegent)

Hello Fabio,
thanks for the reply ..
here i have attached the file of
#head -n 25 /var/adm/syslog/mail.log

kindly go thru it, and please tell me whats the problem..

Thanking you,
Aneesh Mohan
Honored Contributor

Re: mailx problem (Uegent)

Hi Prasad,

Thank you , Happy Diwali you too.

Can you execute the below as a normal user,(not a root user)and please post the o/p

$sendmail -v -d8.99 -d38.99 username@dlmds03.ideacellular.com

Aneesh
prasadb
Super Advisor

Re: mailx problem (Uegent)

Hello Dennis,

> What is the permissions/owner of sendmail?

do you mean

# ls -l /usr/sbin/sendmail
-rwxr-xr-x 1 root mail 864256 May 10 2007 /usr/sbin/sendmail
prasadb
Super Advisor

Re: mailx problem (Uegent)

Aneesh,
see the o/p here,

$ sendmail -v -d8.99 -d38.99 username@dlmds03.ideacellular.com
sh: sendmail: not found.
Aneesh Mohan
Honored Contributor

Re: mailx problem (Uegent)

Hi Prasad,

The permission should be the below , as Mr.Dennis mentioned above

-r-sr-sr-t 1 root mail 864256 Nov 3 2003 /usr/sbin/sendmail


Aneesh
prasadb
Super Advisor

Re: mailx problem (Uegent)

Okay, but please guide me how to do that ..
Dennis Handly
Acclaimed Contributor

Re: mailx problem (Uegent)

>here i have attached the file mail.log
>please tell me what's the problem.

Have you seen these:
forward /home/hramd/.forward+: World writable directory
forward /home/hramd/.forward.dlmds03: World writable directory

Is hramd the user with problems?
You need to make sure the permissions on /home/hramd isn't writable by Other. Also the files .forward+ forward.dlmds03 shouldn't be writable by group or other. Some sendmail configs don't want it readable by them either.
prasadb
Super Advisor

Re: mailx problem (Uegent)

Hello Dennis,
i dont have much idea about mailx as well as sendmail :-(
will you please guide me further what needs to be done and how ?
Dennis Handly
Acclaimed Contributor

Re: mailx problem (Uegent)

-rwxr-xr-x 1 root mail 864256 May 10 2007 /usr/sbin/sendmail

This is bad. You can it it with:
Or: chmod u-w,u+s,g+s,o+t /usr/sbin/sendmail

And check more file permissions:
swverify InternetSrvcs
Fabio Ettore
Honored Contributor

Re: mailx problem (Uegent)

Hi,

as already mentioned I see the following in mail.log:

/home/hramd/.forward+: World writable directory

It could be related to your problem, I suppose hramd is the user who cannot send mails. Please post the output of

ll -d /home/hramd

and check that it's not world writeable, then retry to send a mail by that user.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Dennis Handly
Acclaimed Contributor

Re: mailx problem (Uegent)

>i don't have much idea about mailx as well as sendmail :-( will you please guide me further what needs to be done and how?

After you have fixed sendmail, you can try your mailx command.

You can also use "swverify -F InternetSrvcs" to fix this product.
prasadb
Super Advisor

Re: mailx problem (Uegent)

Hello Fabio,
Here is the o/p of
# ll -d /home/hramd
drwxrwxrwx 3 hramd users 1024 Oct 28 12:10 /home/hramd
prasadb
Super Advisor

Re: mailx problem (Uegent)

Dennis,
Here is the o/p of

# swverify -F InternetSrvcs

======= 10/28/08 13:44:37 IST BEGIN swverify SESSION
(non-interactive) (jobid=dlmds03-0021)

* Session started for user "root@dlmds03".

* Beginning Selection
* Target connection succeeded for "dlmds03:/".
* Software selections:
InternetSrvcs.INET-ENG-A-MAN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.INET-JPN-E-MAN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.INET-JPN-S-MAN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.INETSVCS-BOOT,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.INETSVCS-DTC,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.INETSVCS-INC,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.INETSVCS-INETD,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.INETSVCS-RUN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.RBTD-ENG-A-MAN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.RBTD-JPN-E-MAN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
InternetSrvcs.RBTD-JPN-S-MAN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ KRB-Support.KRB-SUPP-RUN,l=/opt/dce,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ NFS.NFS-CORE,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ NFS.NFS-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ NFS.NFS-SHLIBS,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.LAN-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.LAN-RUN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.LAN2-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ Networking.NET-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.NET-PRG,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.NET-RUN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.NET-RUN-64,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.NET2-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ Networking.NETTL-64SLIB,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.NETTL-MIN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.NMS-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Networking.NMS2-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ OS-Core.C-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OS-Core.CMDS-AUX,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OS-Core.CMDS-MIN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OS-Core.CORE-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OS-Core.CORE-SHLIBS,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OS-Core.CORE2-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ OS-Core.KERN-RUN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OS-Core.KERN2-RUN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ OVSNMPAgent.MASTER,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OVSNMPAgent.SUBAGT-HPUNIX,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ OVSNMPAgent.SUBAGT-MIB2,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ ProgSupport.PROG-AUX,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ ProgSupport.PROG-MIN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Streams.STREAMS-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Streams.STREAMS-RUN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Streams.STREAMS2-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ Streams-TIO.STRTIO-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Streams-TIO.STRTIO-RUN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Streams-TIO.STRTIO2-KRN,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_64
+ TextFormatters.TEXT-FMT,l=/,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
+ Upgrade.UPG-TLINK,l=/opt/upgrade,r=B.11.11,a=HP-UX_B.11.11_32/64,v=HP,fr=B.11.11,fa=HP-UX_B.11.11_32/64
* A "+" indicates an automatic selection due to dependency or
the automatic selection of a patch or reference bundle.
* Selection succeeded.


* Beginning Analysis
* Session selections have been saved in the file
"/.sw/sessions/swverify.last".
WARNING: "dlmds03:/": 30 files had warnings during this operation.
ERROR: "dlmds03:/": 23 files had errors during this operation.
* The analysis phase failed for "dlmds03:/".
* Verification had errors.


* Beginning Execution
* The execution phase succeeded for "dlmds03:/".
* Execution succeeded.


NOTE: More information may be found in the agent logfile using the
command "swjob -a log dlmds03-0021 @ dlmds03:/".

======= 10/28/08 13:48:17 IST END swverify SESSION (non-interactive)
(jobid=dlmds03-0021)
Aneesh Mohan
Honored Contributor

Re: mailx problem (Uegent)

Hi,

Change the premissions on the directory to be 755

chmod 755 /home/hramd

after that please to send the mail again.


Aneesh
Dennis Handly
Acclaimed Contributor
Solution

Re: mailx problem (Uegent)

>drwxrwxrwx 3 hramd users 1024 Oct 28 12:10 /home/hramd

chmod o-w /home/hramd

># swverify -F InternetSrvcs
>ERROR: "dlmds03:/": 23 files had errors during this operation.

Oh boy! Do this to get a list of the bad files:
swjob -a log dlmds03-0021 @ dlmds03:/"

Does mailx now work? If using sendmail by non-root:
$ /usr/sbin/sendmail -v -d8.99 -d38.99 username@dlmds03.ideacellular.com
prasadb
Super Advisor

Re: mailx problem (Uegent)

Hello Geeks,

at last i was able to send the one test mail from the my (normal) login..

Still i have not asked the user to verify it.

But is that Dennis's magical solution

>> Or: chmod u-w,u+s,g+s,o+t /usr/sbin/sendmail

that has worked ?

Aneesh Mohan
Honored Contributor

Re: mailx problem (Uegent)

Hi Prasad,

the 2nd solution could be

Include the following line in sendmail.cf


0 DontBlameSendmail=ForwardFileInUnsafeDirPath

Note:- The above line is starting from "O",you can get the clear idea if you opened the sendmail.cf and search for blame.The default is safe.

This tells sendmail that allow .forward files in unsafe directories

Aneesh
prasadb
Super Advisor

Re: mailx problem (Uegent)

Thank you very much all,

Dennis,
i have attached the o/p of
#swjob -a log dlmds03-0021 @ dlmds03:

kindly go thru it, may be we could find root cause of this problem
Dennis Handly
Acclaimed Contributor

Re: mailx problem (Uegent)

>But is that Dennis' magical solution
>> Or: chmod u-w,u+s,g+s,o+t /usr/sbin/sendmail
>that has worked?

Most likely, or the "swverify -F".