cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding mailx command

SOLVED
Go to solution
Kavita Poonia
Regular Advisor

Regarding mailx command

Hello Folks,

I am not able to send any mail through mailx command from one of my HP-UX server having 11.31 version.

Do I need to configure anything on my server like sendmail...

Thanks * regards,
Kavita
26 REPLIES

Re: Regarding mailx command

Yes, you must set up sendmail.cf
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Hello Patrick,

Its already configured. And when I am trying to start sendmail services I am getting error as mentioned below.

[root@mddxrdd1:/sbin/init.d]#
#-> /sbin/init.d/sendmail stop
Sendmail not running
Sendmail client not running
[root@mddxrdd1:/sbin/init.d]#
#-> /sbin/init.d/sendmail start
Sendmail server is disabled, You cannot start it manually using
sendmail script.


Thanks * regards,
Kavita
James R. Ferguson
Acclaimed Contributor
Solution

Re: Regarding mailx command

Hi Kavita:

You need to configure '/etc/rc.config.d/mailservs'. See the conments therein and those in '/sbin/init.d/sendmail'.

Regards!

...JRF...
Hasan Atasoy
Honored Contributor

Re: Regarding mailx command

hi kavita;

you need to chage start parameter in /etc/rc.config.d/sendmail to start sendmail.


http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1036060




Hasan.
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Yes James, you are absolutely right. I just checked configuration variable in /etc/rc.config.d/mailservs and its value is 0 so I need to change it to 1.

[root@mddxrdd1:/etc/rc.config.d]#
#-> more mailservs
SENDMAIL_SERVER=0


Thank you so much James.

Thanks Hasan.
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Hello All,

I have changed the value of SENDMAIL_SERVER to 1 in /etc/rc.config.d but then also I am not able to start sendmail services. I am not able to send any mail from the server. I am getting below error while starting sendmail.

[root@mddxrdd1:/etc/rc.config.d]#
#-> /sbin/init.d/sendmail stop
Shutting down sendmail [Done]
Sendmail client not running
[root@mddxrdd1:/etc/rc.config.d]#
#-> /sbin/init.d/sendmail start
Starting sendmail [Done]
Unable to start sm-client

For more information see /var/adm/syslog/mail.log


# more mailservs
SENDMAIL_SERVER=1


Please suggest...
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

>For more information see /var/adm/syslog/mail.log

Anything there? Does it have: /etc/mail/submit.cf is missing
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Oh ya Dennis....

Jan 20 17:56:19 mddxrdd1 sm-mta[14929]: starting daemon (@(#)Sendmail version 8.13.3 - Revision 1.000 - 1st August,2006): SMTP+queueing@00:30:
00
Jan 20 17:56:19 mddxrdd1 /sbin/init.d/sendmail[14909]: /etc/mail/submit.cf is missing
Jan 20 17:56:19 mddxrdd1 /sbin/init.d/sendmail[14909]: Sendmail client not started


Thanks * regards,
Kavita
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

What should I do now ?
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

>ME: Does it have: /etc/mail/submit.cf is missing

If it has this, you can probably ignore it.
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

You need to look at /var/adm/syslog/mail.log to see if your messages are being sent. And if so, you need to look at where the messages are sent.
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Hello Dennis,

I created that file submit.cf and after that when I restarted sendmail then I have got below error in /var/adm/syslog/mail.log

Jan 20 18:49:51 mddxrdd1 sm-msp-queue[8248]: sm_gethostbyname:name :mddxrdd1 family:22
Jan 20 18:49:51 mddxrdd1 sm-msp-queue[8248]: NOQUEUE: SYSERR(root): No local mailer defined
Jan 20 18:49:51 mddxrdd1 sm-msp-queue[8248]: NOQUEUE: SYSERR(root): QueueDirectory (Q) option must be set
Jan 20 18:49:51 mddxrdd1 /sbin/init.d/sendmail[8226]: Unable to start sendmail client
Jan 20 18:49:52 mddxrdd1 sm-mta[8247]: sm_gethostbyname:name :smtp.na.jnj.com. family:22
Jan 20 18:49:52 mddxrdd1 sm-mta[8247]: sm_gethostbyname:name :ncsusmea.jnj.com. family:22
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

>I created that file submit.cf

If you don't know what goes there, remove it. I can still sent mail with that warning.

You should restart sendmail and then try sending mail and then show us the logs.

(You may want to replace the actual addresses in the logs with some dummy names.)
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Hello Dennis,

I have removed that file and restarted sendmail but same error is coming as below....

[root@mddxrdd1:/etc/rc.config.d]#
#-> /sbin/init.d/sendmail stop
Sendmail not running
Sendmail client not running
[root@mddxrdd1:/etc/rc.config.d]#
#-> /sbin/init.d/sendmail start
Starting sendmail [Done]
Unable to start sm-client

For more information see /var/adm/syslog/mail.log

Jan 20 19:21:05 mddxrdd1 /sbin/init.d/sendmail[24102]: #### Starting sendmail ####
Jan 20 19:21:05 mddxrdd1 sendmail[24119]: sm_gethostbyname:name :mddxrdd1 family:22
Jan 20 19:21:05 mddxrdd1 sendmail[24119]: alias database /etc/mail/aliases rebuilt by kpoonia
Jan 20 19:21:05 mddxrdd1 sendmail[24119]: /etc/mail/aliases: 7 aliases, longest 9 bytes, 88 bytes total
Jan 20 19:21:05 mddxrdd1 /sbin/init.d/sendmail[24102]: /etc/mail/aliases: 7 aliases, longest 9 bytes, 88 bytes total
Jan 20 19:21:05 mddxrdd1 sm-mta[24121]: sm_gethostbyname:name :mddxrdd1 family:22
Jan 20 19:21:05 mddxrdd1 sm-mta[24122]: starting daemon (@(#)Sendmail version 8.13.3 - Revision 1.000 - 1st August,2006): SMTP+queueing@00:30:
00
Jan 20 19:21:05 mddxrdd1 /sbin/init.d/sendmail[24102]: /etc/mail/submit.cf is missing
Jan 20 19:21:05 mddxrdd1 /sbin/init.d/sendmail[24102]: Sendmail client not started
Jan 20 19:21:06 mddxrdd1 sm-mta[24125]: sm_gethostbyname:name :smtp.na.jnj.com. family:22
Jan 20 19:21:06 mddxrdd1 sm-mta[24125]: sm_gethostbyname:name :ncsusmea.jnj.com. family:22


Further, I tried sending mails but I am not receiving them on delvered email id

You are talking about replacing which actual names ????


Thanks * regards,
Kavita
Steven E. Protter
Exalted Contributor

Re: Regarding mailx command

Shalom,

I am considered knowledgeable on sendmail, and not one time in ten years of use have I ever changed submit.cf

Note:

To merely send outbound mail, the sendmail daemon need not run. You can run the sendmail -v -q command in a cron job and run the queue to deliver outbound mail.

Not being able to run the client as noted in your last message does not to my knowledge impact sendmail functionality at all.

For your reading pleasure:
http://www.hpux.ws/?p=5

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
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Hello SEP,

WE already have sendmail configured in cronjobs....

#Sendmail queue
0 8,11,15 * * * /usr/sbin/sendmail -q > /var/adm/log/sendmail.log 2>&1


I do not know what to do here.....

Your provided link is also not opening.

Thanks * regards,
Kavita
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

>I tried sending mails

I don't see any mail.log messages saying you sent mail or an error occurred sending it.

>You are talking about replacing which actual names?

I'm saying that if you just paste your mail.log output here, you should be careful that spammers don't pick up your mail addresses.
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Oh I see......


I did send mail but I forgot to paste the logs. Here they are...

Jan 20 19:21:07 mddxrdd1 sm-mta[24125]: n0KMgBsA007806: to=kpoonia@its.jnj.com, ctladdr=kpoonia (24545/8649), delay=01:38:56, xdelay=00:00:00,
mailer=relay, pri=570136, relay=ncsusraexmea2.na.jnj.com, dsn=4.0.0, stat=Deferred
Jan 20 19:21:07 mddxrdd1 sm-mta[24125]: n0KMts85014779: to=kpoonia@its.jnj.com, ctladdr=kpoonia (24545/8649), delay=01:25:13, xdelay=00:00:00,
mailer=relay, pri=570136, relay=ncsusraexmea2.na.jnj.com, dsn=4.0.0, stat=Deferred


The command which I tried sending mail is as follows....

echo "test"|mailx -s "yip" kpoonia@its.jnj.com


Thanks * regards,
Kavita
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

>to=kpoonia@its.jnj.com
>kpoonia@its.jnj.com

Here is where I cautioned you not to put your real address. nslookup can't find it so is it fake?

>... stat=Deferred

This says it is having problems sending it.
What does mailq show?
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Hello Dennis,

Please find the mailq output.

[root@mddxrdd1:/.root]#
#-> mailq -v
/var/spool/mqueue (63 requests)
-----Q-ID----- --Size-- -Priority- ---Q-Time--- --------Sender/Recipient--------
n0LGNlOC021292 46082 465665 Jan 21 11:23 MAILER-DAEMON
(reply: read error from smtp.na.jnj.com.)
(---:root---)
jle@ds.com
UnixS@ds.com
(reply: read error from smtp.na.jnj.com.)
n0LGNlOD021292 48985 468568 Jan 21 11:23 MAILER-DAEMON
(Deferred)
(---:root---)
jle7@it.com
UnixS@i.jnj.com
(Deferred)
n0LGNlOE021292 54233 473816 Jan 21 11:23 MAILER-DAEMON
(Deferred)
(---:root---)
jl@i.jj.com
UnixS@it.com
(Deferred)
n0LDNHOC027194 10962 1060545 Jan 21 08:23 MAILER-DAEMON
(Deferred)
(---:root---)
jle@ds.jj.com
UnixS@jj.com
(Deferred)
n0LDNHOD027194 15888 1065471 Jan 21 08:23 MAILER-DAEMON
(Deferred)
(---:root---)
jln7@it.com
UnixS@it.com
(Deferred)
n0LDNHOE027194 16139 1065722 Jan 21 08:23 MAILER-DAEMON
(Deferred)
(---:root---)
jl7@it.com
UnixS@it.com
(Deferred)


We have around 63 entries like this in mailq command.

Actual addresses are not used here.

Thanks * regards,
Kavita
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

>relay=ncsusraexmea2.na.jnj.com

Can you look at the logs on this machine?

>Please find the mailq output.

It seems it doesn't like these aliases. Does mail work to any places at all?
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Hello Dennis,

What should I see for ncsusraexmea2.na.jnj.com ?

No mails are not delivered anywhere. We need to setup sendmail client at the earliest.

Thanks * regards,
Kavita
Dennis Handly
Acclaimed Contributor

Re: Regarding mailx command

>What should I see for ncsusraexmea2.na.jnj.com?

Something in mail.log to say why it refused the mail.

Also what changes have you made in sendmail.cf?

You might want to search other threads for configure and sendmail:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1159697
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1049130
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=610438
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=999188
Kavita Poonia
Regular Advisor

Re: Regarding mailx command

Okay Dennis.....let me see that and get back to you.....thanks